背景
pytest的命令行选项可以设置pytest的运行方式和运行结果。了解各种命令选项的含义,有助于我们根据测试场景,更灵活的使用pytest。
如何查看全部命令行选项
windows系统下,打开cmd,输入pytest --help
常用命令行选项介绍
–collect-only
该选项不启动测试,执行该命令选项,仅会罗列出当前设置下,将会被执行的用例。
示例1:
import pytest
if __name__ == '__main__':
pytest.main(['--collect-only'])
'''
# stdout
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items
<Module test_case/test_func.py>
<Class TestFunc>
<Function test_add_by_class>
<Function test_add_by_func_aaa>
============================ no tests ran in 0.04s ============================
[Finished in 1.3s]
'''
示例2:
import pytest
if __name__ == '__main__':
pytest.main(['./test_case/test_func.py::TestFunc::test_add_by_class','--collect-only'])
'''
# stdout
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 1 item
<Module test_case/test_func.py>
<Class TestFunc>
<Function test_add_by_class>
============================ no tests ran in 0.02s ============================
[Finished in 1.3s]
'''
示例3:
import pytest
if __name__ == '__main__':
pytest.main(['-k','aaa','--collect-only'])
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items / 1 deselected / 1 selected
<Module test_case/test_func.py>
<Function test_add_by_func_aaa>
============================ 1 deselected in 0.04s ============================
[Finished in 1.4s]
如上示例,可以理解,该配置可以使得测试人员在不实际执行测试的情况下,预先检查哪些测试用例被执行。
-k
该选项可指定参数,参数为字符串格式,该字符串参数的目的是用来部分或全部匹配测试用例名称。使用该选项,pytest仅会收集测试用例名称中包含参数的测试用例执行测试。
示例:自动化测试用例集中一共有两个用例,分别命名:test_add_by_class、test_add_by_func_aaa。如下示例只会运行命名中包含‘aaa’的测试用例。
import pytest
if __name__ == '__main__':
pytest.main(['-k','aaa'])
‘’‘
# stdout:
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items / 1 deselected / 1 selected
test_case\test_func.py . [100%]
======================= 1 passed, 1 deselected in 0.05s =======================
[Finished in 1.6s]
’‘’
-m
该选项用于执行符合指定标记的测试用例。与@pytest.mark.mark_name这样的装饰器搭配使用(mark_name自定义)。@pytest.mark.mark_name装饰器标记用例,-m选项的参数是mark_name,配合使用即可达到按标记给测试用例分组,并按标记执行用例的效果。 详情见示例:
# ./test_case/test_func.py
import pytest
from func import *
class TestFunc:
def test_add_by_class(self):
assert add(2,3) == 5
@pytest.mark.run_it
def test_add_by_func_aaa():
assert add(4,6) == 10
# ./run_test.py
import pytest
if __name__ == '__main__':
pytest.main(['-v','-m','run_it'])
'''
# stdout:
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1 -- D:\Python3.7\python.exe
cachedir: .pytest_cache
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collecting ... collected 2 items / 1 deselected / 1 selected
test_case/test_func.py::test_add_by_func_aaa PASSED [100%]
============================== warnings summary ===============================
D:\Python3.7\lib\site-packages\_pytest\mark\structures.py:327
D:\Python3.7\lib\site-packages\_pytest\mark\structures.py:327: PytestUnknownMarkWarning: Unknown pytest.mark.run_it - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
PytestUnknownMarkWarning,
-- Docs: https://docs.pytest.org/en/latest/warnings.html
================= 1 passed, 1 deselected, 1 warning in 0.05s ==================
[Finished in 1.4s]
'''
运行结果显示,只有被标记的用例得到选中被执行,没有被标记的用例被deselected。还有一个警告是因为我们的run_it标记名没有被注册。这个注册可以在pytest.ini中进行配置注册。与此文无关,暂不说明。
-x
-x选项,使得pytest遇到第一个失败用例即可终止测试。方便调试。pytest正常模式下,即使遇到失败用例,也会继续执行测试直到所有应该被执行的用例全部执行。
–maxfail=num
-maxfail相对于-x的特点是,可以指定遇到第几个失败用例时,才会停止测试。参数num为正整型数。
-s
该选项可以捕获标准输出中的信息。在没有使用-s时,测试用例通过时,我们测试脚本中的print()函数打印的信息无法在编辑器的打印台中看见。只有用例失败时,才可以看见这些print()函数打印的信息。这种模式下,对于调试程序非常不方便。使用-s选项,可以使得即使用例通过,我们也可以在打印台看见print()信息。
示例:
# ./test_case/test_func.py
import pytest
from func import *
class TestFunc:
def test_add_by_class(self):
#添加print调试信息
print("2+3=5")
assert add(2,3) == 5
@pytest.mark.run_it
def test_add_by_func_aaa():
assert add(4,6) == 10
# ./run_test.py
# 没有-s选项
import pytest
if __name__ == '__main__':
pytest.main(['./test_case'])
'''
# stdout:
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items
test_case\test_func.py .. [100%]
============================== 2 passed in 0.02s ==============================
[Finished in 1.4s]
'''
# ./run_test.py
# 有-s选项
import pytest
if __name__ == '__main__':
pytest.main(['-s','./test_case'])
'''
# stdout:
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items
test_case\test_func.py 2+3=5
..
============================== 2 passed in 0.02s ==============================
[Finished in 1.3s]
'''
–lf
该选项,可以运行上一个测试中失败的用例。当我们一个测试用例集执行完成后,经常会有几个失败的用例,再此运行测试时,使用该选项,即会将之前失败的用例再执行一遍,检查是否有因为环境原因导致的执行失败。
示例:
import pytest
if __name__ == '__main__':
pytest.main(['--lf'])
'''
# stdout:
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items / 1 deselected / 1 selected
run-last-failure: rerun previous 1 failure (skipped 2 files)
test_case\test_func.py F [100%]
================================== FAILURES ===================================
____________________________ test_add_by_func_aaa _____________________________
def test_add_by_func_aaa():
> assert add(4,6) == 9
E assert 10 == 9
E + where 10 = add(4, 6)
test_case\test_func.py:12: AssertionError
======================= 1 failed, 1 deselected in 0.08s =======================
[Finished in 1.4s]
'''
以上示例中,之前通过的用例,被deselected。只执行了上次失败的用例。
–ff
该选项,与–lf相比,会执行所有用例,但是会把之前失败的用例由优先执行。
-v
该选项可以使得测试输出更加详细。直观的一点,加上该选项,测试输出中会把用例名打印出来。
示例:
import pytest
if __name__ == '__main__':
pytest.main(['-v'])
'''
# stdout:
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1 -- D:\Python3.7\python.exe
cachedir: .pytest_cache
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collecting ... collected 2 items
test_case/test_func.py::TestFunc::test_add_by_class PASSED [ 50%]
test_case/test_func.py::test_add_by_func_aaa PASSED [100%]
============================== 2 passed in 0.05s ==============================
[Finished in 1.6s]
'''
-q
该选项与-v的作用相反,会简化输出信息。
import pytest
if __name__ == '__main__':
pytest.main(['-q'])
'''
# stdout:
.. [100%]
2 passed in 0.03s
[Finished in 1.5s]
'''
-l
该选项,会使得用例执行失败时,打印出其局部变量。
示例:
# ./test_case/test_func.py
import pytest
from func import *
class TestFunc:
def test_add_by_class(self):
assert add(2,3) == 5
def test_add_by_func_aaa():
a = 4
b = 6
assert add(a,b) == 10
# ./run_test.py
import pytest
if __name__ == '__main__':
pytest.main(['-l'])
'''
# stdout:
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items
test_case\test_func.py .F [100%]
================================== FAILURES ===================================
____________________________ test_add_by_func_aaa _____________________________
def test_add_by_func_aaa():
a = 4
b = 6
> assert add(a,b) == 9
E assert 10 == 9
E + where 10 = add(4, 6)
a = 4
b = 6
test_case\test_func.py:14: AssertionError
========================= 1 failed, 1 passed in 0.10s =========================
[Finished in 1.4s]
'''
–tb=style
该选项通过选择style的取值,选择用例失败时输出信息规格。没有改选项时,默认是把信息回溯到的所有信息打印出来,信息两详细,但不直观。style通常可以取值short,line, no。依次代表信息规格越来越小。
示例:没有–tb=sytle,失败信息比较多。
import pytest
if __name__ == '__main__':
pytest.main([''])
'''
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items
test_case\test_func.py .F [100%]
================================== FAILURES ===================================
____________________________ test_add_by_func_aaa _____________________________
def test_add_by_func_aaa():
a = 4
b = 6
> assert add(a,b) == 9
E assert 10 == 9
E + where 10 = add(4, 6)
test_case\test_func.py:14: AssertionError
========================= 1 failed, 1 passed in 0.10s =========================
[Finished in 1.4s]
'''
示例2:–tb = short .
import pytest
if __name__ == '__main__':
pytest.main(['--tb=short'])
'''
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items
test_case\test_func.py .F [100%]
================================== FAILURES ===================================
____________________________ test_add_by_func_aaa _____________________________
test_case\test_func.py:14: in test_add_by_func_aaa
assert add(a,b) == 9
E assert 10 == 9
E + where 10 = add(4, 6)
========================= 1 failed, 1 passed in 0.10s =========================
[Finished in 1.5s]
'''
示例3: --tb=line
import pytest
if __name__ == '__main__':
pytest.main(['--tb=line'])
'''
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items
test_case\test_func.py .F [100%]
================================== FAILURES ===================================
D:\Python3.7\project\pytest\test_case\test_func.py:14: assert 10 == 9
========================= 1 failed, 1 passed in 0.10s =========================
[Finished in 1.4s]
'''
示例4: --tb = no
import pytest
if __name__ == '__main__':
pytest.main(['--tb=no'])
'''
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.3.4, py-1.8.1, pluggy-0.13.1
rootdir: D:\Python3.7\project\pytest
plugins: allure-pytest-2.8.9, rerunfailures-8.0
collected 2 items
test_case\test_func.py .F [100%]
========================= 1 failed, 1 passed in 0.10s =========================
[Finished in 1.4s]
'''
以上,就是日常使用中常见的命令行选项。
完整选项可通过pytest --help查看
pytest的版本可通过 pytest --version
示例:
import pytest
if __name__ == '__main__':
pytest.main(['--version'])
'''
This is pytest version 5.3.4, imported from D:\Python3.7\lib\site-packages\pytest\__init__.py
setuptools registered plugins:
allure-pytest-2.8.9 at D:\Python3.7\lib\site-packages\allure_pytest\plugin.py
pytest-rerunfailures-8.0 at D:\Python3.7\lib\site-packages\pytest_rerunfailures.py
[Finished in 1.3s]
'''
import pytest
if __name__ == '__main__':
pytest.main(['--help'])
'''
usage: run_test.py [options] [file_or_dir] [file_or_dir] [...]
positional arguments:
file_or_dir
general:
-k EXPRESSION only run tests which match the given substring
expression. An expression is a python evaluatable
expression where all names are substring-matched against
test names and their parent classes. Example: -k
'test_method or test_other' matches all test functions
and classes whose name contains 'test_method' or
'test_other', while -k 'not test_method' matches those
that don't contain 'test_method' in their names. -k 'not
test_method and not test_other' will eliminate the
matches. Additionally keywords are matched to classes
and functions containing extra names in their
'extra_keyword_matches' set, as well as functions which
have names assigned directly to them.
-m MARKEXPR only run tests matching given mark expression. example:
-m 'mark1 and not mark2'.
--markers show markers (builtin, plugin and per-project ones).
-x, --exitfirst exit instantly on first error or failed test.
--maxfail=num exit after first num failures or errors.
--strict-markers, --strict
markers not registered in the `markers` section of the
configuration file raise errors.
-c file load configuration from `file` instead of trying to
locate one of the implicit configuration files.
--continue-on-collection-errors
Force test execution even if collection errors occur.
--rootdir=ROOTDIR Define root directory for tests. Can be relative path:
'root_dir', './root_dir', 'root_dir/another_dir/';
absolute path: '/home/user/root_dir'; path with
variables: '$HOME/root_dir'.
--fixtures, --funcargs
show available fixtures, sorted by plugin appearance
(fixtures with leading '_' are only shown with '-v')
--fixtures-per-test show fixtures per test
--import-mode={prepend,append}
prepend/append to sys.path when importing test modules,
default is to prepend.
--pdb start the interactive Python debugger on errors or
KeyboardInterrupt.
--pdbcls=modulename:classname
start a custom interactive Python debugger on errors.
For example:
--pdbcls=IPython.terminal.debugger:TerminalPdb
--trace Immediately break when running each test.
--capture=method per-test capturing method: one of fd|sys|no.
-s shortcut for --capture=no.
--runxfail report the results of xfail tests as if they were not
marked
--lf, --last-failed rerun only the tests that failed at the last run (or all
if none failed)
--ff, --failed-first run all tests but run the last failures first. This may
re-order tests and thus lead to repeated fixture
setup/teardown
--nf, --new-first run tests from new files first, then the rest of the
tests sorted by file mtime
--cache-show=[CACHESHOW]
show cache contents, don't perform collection or tests.
Optional argument: glob (default: '*').
--cache-clear remove all cache contents at start of test run.
--lfnf={all,none}, --last-failed-no-failures={all,none}
which tests to run with no previously (known) failures.
--sw, --stepwise exit on test failure and continue from last failing test
next time
--stepwise-skip ignore the first failing test but stop on the next
failing test
--allure-severities=SEVERITIES_SET
Comma-separated list of severity names. Tests only with
these severities will be run. Possible values are:
blocker, critical, normal, minor, trivial.
--allure-epics=EPICS_SET
Comma-separated list of epic names. Run tests that have
at least one of the specified feature labels.
--allure-features=FEATURES_SET
Comma-separated list of feature names. Run tests that
have at least one of the specified feature labels.
--allure-stories=STORIES_SET
Comma-separated list of story names. Run tests that have
at least one of the specified story labels.
--allure-link-pattern=LINK_TYPE:LINK_PATTERN
Url pattern for link type. Allows short links in test,
like 'issue-1'. Text will be formatted to full url with
python str.format().
reporting:
--durations=N show N slowest setup/test durations (N=0 for all).
-v, --verbose increase verbosity.
-q, --quiet decrease verbosity.
--verbosity=VERBOSE set verbosity. Default is 0.
-r chars show extra test summary info as specified by chars:
(f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed,
(p)assed, (P)assed with output, (a)ll except passed
(p/P), or (A)ll. (w)arnings are enabled by default (see
--disable-warnings).
--disable-warnings, --disable-pytest-warnings
disable warnings summary
-l, --showlocals show locals in tracebacks (disabled by default).
--tb=style traceback print mode (auto/long/short/line/native/no).
--show-capture={no,stdout,stderr,log,all}
Controls how captured stdout/stderr/log is shown on
failed tests. Default is 'all'.
--full-trace don't cut any tracebacks (default is to cut).
--color=color color terminal output (yes/no/auto).
--pastebin=mode send failed|all info to bpaste.net pastebin service.
--junit-xml=path create junit-xml style report file at given path.
--junit-prefix=str prepend prefix to classnames in junit-xml output
--result-log=path DEPRECATED path for machine-readable result log.
collection:
--collect-only, --co only collect tests, don't execute them.
--pyargs try to interpret all arguments as python packages.
--ignore=path ignore path during collection (multi-allowed).
--ignore-glob=path ignore path pattern during collection (multi-allowed).
--deselect=nodeid_prefix
deselect item during collection (multi-allowed).
--confcutdir=dir only load conftest.py's relative to specified dir.
--noconftest Don't load any conftest.py files.
--keep-duplicates Keep duplicate tests.
--collect-in-virtualenv
Don't ignore tests in a local virtualenv directory
--doctest-modules run doctests in all .py modules
--doctest-report={none,cdiff,ndiff,udiff,only_first_failure}
choose another output format for diffs on doctest
failure
--doctest-glob=pat doctests file matching pattern, default: test*.txt
--doctest-ignore-import-errors
ignore doctest ImportErrors
--doctest-continue-on-failure
for a given doctest, continue to run after the first
failure
test session debugging and configuration:
--basetemp=dir base temporary directory for this test run.(warning:
this directory is removed if it exists)
--version display pytest lib version and import information.
-h, --help show help message and configuration info
-p name early-load given plugin module name or entry point
(multi-allowed). To avoid loading of plugins, use the
`no:` prefix, e.g. `no:doctest`.
--trace-config trace considerations of conftest.py files.
--debug store internal tracing debug information in
'pytestdebug.log'.
-o OVERRIDE_INI, --override-ini=OVERRIDE_INI
override ini option with "option=value" style, e.g. `-o
xfail_strict=True -o cache_dir=cache`.
--assert=MODE Control assertion debugging tools. 'plain' performs no
assertion debugging. 'rewrite' (the default) rewrites
assert statements in test modules on import to provide
assert expression information.
--setup-only only setup fixtures, do not execute tests.
--setup-show show setup of fixtures while executing tests.
--setup-plan show what fixtures and tests would be executed but don't
execute anything.
pytest-warnings:
-W PYTHONWARNINGS, --pythonwarnings=PYTHONWARNINGS
set which warnings to report, see -W option of python
itself.
logging:
--no-print-logs disable printing caught logs on failed tests.
--log-level=LOG_LEVEL
logging level used by the logging module
--log-format=LOG_FORMAT
log format as used by the logging module.
--log-date-format=LOG_DATE_FORMAT
log date format as used by the logging module.
--log-cli-level=LOG_CLI_LEVEL
cli logging level.
--log-cli-format=LOG_CLI_FORMAT
log format as used by the logging module.
--log-cli-date-format=LOG_CLI_DATE_FORMAT
log date format as used by the logging module.
--log-file=LOG_FILE path to a file when logging will be written to.
--log-file-level=LOG_FILE_LEVEL
log file logging level.
--log-file-format=LOG_FILE_FORMAT
log format as used by the logging module.
--log-file-date-format=LOG_FILE_DATE_FORMAT
log date format as used by the logging module.
--log-auto-indent=LOG_AUTO_INDENT
Auto-indent multiline messages passed to the logging
module. Accepts true|on, false|off or an integer.
reporting:
--alluredir=DIR Generate Allure report in the specified directory (may
not exist)
--clean-alluredir Clean alluredir folder if it exists
--allure-no-capture Do not attach pytest captured logging/stdout/stderr to
report
re-run failing tests to eliminate flaky failures:
--reruns=RERUNS number of times to re-run failed tests. defaults to 0.
--reruns-delay=RERUNS_DELAY
add time (seconds) delay between reruns.
[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.
usefixtures (args): list of default fixtures to be used with this project
python_files (args): glob-style file patterns for Python test module
discovery
python_classes (args):
prefixes or glob names for Python test class discovery
python_functions (args):
prefixes or glob names for Python test function and
method discovery
disable_test_id_escaping_and_forfeit_all_rights_to_community_support (bool):
disable string escape non-ascii characters, might cause
unwanted side effects(use at your own risk)
console_output_style (string):
console output: "classic", or with additional progress
information ("progress" (percentage) | "count").
xfail_strict (bool): default for the strict parameter of xfail markers when
not given explicitly (default: False)
enable_assertion_pass_hook (bool):
Enables the pytest_assertion_pass hook.Make sure to
delete any previously generated pyc cache files.
junit_suite_name (string):
Test suite name for JUnit report
junit_logging (string):
Write captured log messages to JUnit report: one of
no|system-out|system-err
junit_log_passing_tests (bool):
Capture log information for passing tests to JUnit
report:
junit_duration_report (string):
Duration time to report: one of total|call
junit_family (string):
Emit XML for schema: one of legacy|xunit1|xunit2
doctest_optionflags (args):
option flags for doctests
doctest_encoding (string):
encoding used for doctest files
cache_dir (string): cache directory path.
filterwarnings (linelist):
Each line specifies a pattern for
warnings.filterwarnings. Processed after
-W/--pythonwarnings.
log_print (bool): default value for --no-print-logs
log_level (string): default value for --log-level
log_format (string): default value for --log-format
log_date_format (string):
default value for --log-date-format
log_cli (bool): enable log display during test run (also known as "live
logging").
log_cli_level (string):
default value for --log-cli-level
log_cli_format (string):
default value for --log-cli-format
log_cli_date_format (string):
default value for --log-cli-date-format
log_file (string): default value for --log-file
log_file_level (string):
default value for --log-file-level
log_file_format (string):
default value for --log-file-format
log_file_date_format (string):
default value for --log-file-date-format
log_auto_indent (string):
default value for --log-auto-indent
faulthandler_timeout (string):
Dump the traceback of all threads if a test takes more
than TIMEOUT seconds to finish. Not available on
Windows.
addopts (args): extra command line options
minversion (string): minimally required pytest version
environment variables:
PYTEST_ADDOPTS extra command line options
PYTEST_PLUGINS comma-separated plugins to load during startup
PYTEST_DISABLE_PLUGIN_AUTOLOAD set to disable plugin auto-loading
PYTEST_DEBUG set to enable debug tracing of pytest's internals
to see available markers type: pytest --markers
to see available fixtures type: pytest --fixtures
(shown according to specified file_or_dir or current dir if not specified; fixtures with leading '_' are only shown with the '-v' option
[Finished in 1.3s]
'''