From 71b440e386db52d6579e5051c429907d0c115c82 Mon Sep 17 00:00:00 2001 From: johnrohan87 Date: Thu, 30 Apr 2020 02:05:01 +0000 Subject: [PATCH] adding class files --- conftest.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..38825f5 --- /dev/null +++ b/conftest.py @@ -0,0 +1,20 @@ +import sys +def pytest_addoption(parser): + parser.addoption("--stdin", action="append", default=[], + help="json with the stdin to pass to test functions") + +def pytest_generate_tests(metafunc): + if 'stdin' in metafunc.fixturenames: + metafunc.parametrize("stdin",metafunc.config.getoption('stdin')) + + if 'app' in metafunc.fixturenames: + try: + sys.path.append('./.breathecode/dist') + import cached_app + metafunc.parametrize("app",[cached_app.execute_app]) + except SyntaxError: + metafunc.parametrize("app",[lambda : None]) + except ImportError: + metafunc.parametrize("app",[cached_app]) + except AttributeError: + metafunc.parametrize("app",[cached_app])