conftest.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # jogai - Python Game Library
  2. #
  3. # This library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Library General Public
  5. # License as published by the Free Software Foundation; either
  6. # version 2 of the License, or (at your option) any later version.
  7. #
  8. # This library is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. # Library General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU Library General Public
  14. # License along with this library; if not, write to the Free
  15. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. #
  17. # Ramón Palleiro Rodríguez
  18. # Zero! Factorial Studio
  19. # info@zero.gal
  20. import pytest
  21. from pygame.display import get_init
  22. from jogai import videogame as vg
  23. from jogai.groups import Group, SquareGroup
  24. @vg.prepare('test')
  25. def test_code():
  26. ...
  27. @pytest.fixture(scope='class')
  28. def videogame_test():
  29. vg.init()
  30. vg.load_environment('test')
  31. yield vg
  32. @pytest.fixture
  33. def scene_filename_test():
  34. return 'scene.png'
  35. @pytest.fixture
  36. def character_filename_test():
  37. return 'protagonist.png'
  38. @pytest.fixture(scope='class')
  39. def character_test():
  40. return protagonist
  41. @pytest.fixture
  42. def character_name_test():
  43. return 'protagonist'
  44. @pytest.fixture
  45. def secondary_character_test():
  46. return secondary
  47. @pytest.fixture
  48. def group_name_test():
  49. return 'protagonists'
  50. @pytest.fixture
  51. def group_character_test(character_test):
  52. return character_test
  53. @pytest.fixture
  54. def simple_group_test(group_name_test, group_character_test):
  55. return Group(group_name_test, [group_character_test])
  56. @pytest.fixture
  57. def square_group_test(group_name_test, group_character_test):
  58. return SquareGroup(group_name_test, group_character_test, 2)
  59. @pytest.fixture
  60. def random_group_test():
  61. return bricks