Configuration
pytest.ini: ΠΡΠΎ ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠΉ ΡΠ°ΠΉΠ» ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ Pytest, ΠΊΠΎΡΠΎΡΡΠΉ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ Π²Π°ΠΌ ΠΈΠ·ΠΌΠ΅Π½ΠΈΡΡ ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅ ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ. ΠΠΎΡΠΊΠΎΠ»ΡΠΊΡ Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ Π²Π½Π΅ΡΡΠΈ Π΄ΠΎΠ²ΠΎΠ»ΡΠ½ΠΎ ΠΌΠ½ΠΎΠ³ΠΎ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ Π² ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ, Π±ΠΎΠ»ΡΡΠ°Ρ ΡΠ°ΡΡΡ ΡΡΠΎΠΉ Π³Π»Π°Π²Ρ ΠΏΠΎΡΠ²ΡΡΠ΅Π½Π° Π½Π°ΡΡΡΠΎΠΉΠΊΠ°ΠΌ, ΠΊΠΎΡΠΎΡΡΠ΅ Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΡΠ΄Π΅Π»Π°ΡΡ Π²
pytest.ini
.conftest.py: ΠΡΠΎ Π»ΠΎΠΊΠ°Π»ΡΠ½ΡΠΉ ΠΏΠ»Π°Π³ΠΈΠ½, ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡΡΠΈΠΉ ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠ°ΡΡ Ρ ΡΠΊ-ΡΡΠ½ΠΊΡΠΈΠΈ ΠΈ ΡΠΈΠΊΡΡΡΡΡ Π΄Π»Ρ ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π°, Π² ΠΊΠΎΡΠΎΡΠΎΠΌ ΡΡΡΠ΅ΡΡΠ²ΡΠ΅Ρ ΡΠ°ΠΉΠ»
conftest.py
, ΠΈ Π²ΡΠ΅Ρ Π΅Π³ΠΎ ΠΏΠΎΠ΄ΠΊΠ°ΡΠ°Π»ΠΎΠ³ΠΎΠ².__init__.py
: ΠΡΠΈ ΠΏΠΎΠΌΠ΅ΡΠ΅Π½ΠΈΠΈ Π² ΠΊΠ°ΠΆΠ΄ΡΠΉ test-ΠΏΠΎΠ΄ΠΊΠ°ΡΠ°Π»ΠΎΠ³ ΡΡΠΎΡ ΡΠ°ΠΉΠ» ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ Π²Π°ΠΌ ΠΈΠΌΠ΅ΡΡ ΠΈΠ΄Π΅Π½ΡΠΈΡΠ½ΡΠ΅ ΠΈΠΌΠ΅Π½Π° test-ΡΠ°ΠΉΠ»ΠΎΠ² Π² Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΈΡ ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π°Ρ test.
ΠΡ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΏΠΎΠ»ΡΡΠΈΡΡ ΡΠΏΠΈΡΠΎΠΊ Π²ΡΠ΅Ρ
Π΄ΠΎΠΏΡΡΡΠΈΠΌΡΡ
ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠΎΠ² Π΄Π»Ρ pytest.ini
ΠΈΠ· pytest --help
:
$ pytest --help
...
[pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found:
markers (linelist) markers for test functions
empty_parameter_set_mark (string) default marker for empty parametersets
norecursedirs (args) directory patterns to avoid for recursion
testpaths (args) directories to search for tests when no files or directories are given in the command line.
console_output_style (string) console output: classic or with additional progress information (classic|progress).
usefixtures (args) list of default fixtures to be used with this project
...
ΠΠΎΠ΄ΡΠΎΠ±Π½Π΅Π΅: https://habr.com/ru/articles/448796/
Last updated