Best Python code snippet using pytest-django_python
test_functional.py
Source:test_functional.py
1# Copyright (c) Microsoft Corporation. All rights reserved.2# Licensed under the MIT License.3from __future__ import absolute_import, unicode_literals4import json5import os6import os.path7import subprocess8import sys9import unittest10from ...__main__ import TESTING_TOOLS_ROOT11from testing_tools.adapter.util import fix_path, PATH_SEP12# Pytest 3.7 and later uses pathlib/pathlib2 for path resolution.13try:14 from pathlib import Path15except ImportError:16 from pathlib2 import Path # type: ignore (for Pylance)17CWD = os.getcwd()18DATA_DIR = os.path.join(os.path.dirname(__file__), ".data")19SCRIPT = os.path.join(TESTING_TOOLS_ROOT, "run_adapter.py")20def resolve_testroot(name):21 projroot = os.path.join(DATA_DIR, name)22 testroot = os.path.join(projroot, "tests")23 return str(Path(projroot).resolve()), str(Path(testroot).resolve())24def run_adapter(cmd, tool, *cliargs):25 try:26 return _run_adapter(cmd, tool, *cliargs)27 except subprocess.CalledProcessError as exc:28 print(exc.output)29def _run_adapter(cmd, tool, *cliargs, **kwargs):30 hidestdio = kwargs.pop("hidestdio", True)31 assert not kwargs or tuple(kwargs) == ("stderr",)32 kwds = kwargs33 argv = [sys.executable, SCRIPT, cmd, tool, "--"] + list(cliargs)34 if not hidestdio:35 argv.insert(4, "--no-hide-stdio")36 kwds["stderr"] = subprocess.STDOUT37 argv.append("--cache-clear")38 print(39 "running {!r}".format(" ".join(arg.rpartition(CWD + "/")[-1] for arg in argv))40 )41 output = subprocess.check_output(argv, universal_newlines=True, **kwds)42 return output43def fix_test_order(tests):44 if sys.version_info >= (3, 6):45 return tests46 fixed = []47 curfile = None48 group = []49 for test in tests:50 if (curfile or "???") not in test["id"]:51 fixed.extend(sorted(group, key=lambda t: t["id"]))52 group = []53 curfile = test["id"].partition(".py::")[0] + ".py"54 group.append(test)55 fixed.extend(sorted(group, key=lambda t: t["id"]))56 return fixed57def fix_source(tests, testid, srcfile, lineno):58 for test in tests:59 if test["id"] == testid:60 break61 else:62 raise KeyError("test {!r} not found".format(testid))63 if not srcfile:64 srcfile = test["source"].rpartition(":")[0]65 test["source"] = fix_path("{}:{}".format(srcfile, lineno))66def sorted_object(obj):67 if isinstance(obj, dict):68 return sorted((key, sorted_object(obj[key])) for key in obj.keys())69 if isinstance(obj, list):70 return sorted((sorted_object(x) for x in obj))71 else:72 return obj73# Note that these tests are skipped if util.PATH_SEP is not os.path.sep.74# This is because the functional tests should reflect the actual75# operating environment.76class PytestTests(unittest.TestCase):77 def setUp(self):78 if PATH_SEP is not os.path.sep:79 raise unittest.SkipTest("functional tests require unmodified env")80 super(PytestTests, self).setUp()81 def complex(self, testroot):82 results = COMPLEX.copy()83 results["root"] = testroot84 return [results]85 def test_discover_simple(self):86 projroot, testroot = resolve_testroot("simple")87 out = run_adapter("discover", "pytest", "--rootdir", projroot, testroot)88 result = json.loads(out)89 self.maxDiff = None90 self.assertEqual(91 result,92 [93 {94 "root": projroot,95 "rootid": ".",96 "parents": [97 {98 "id": "./tests",99 "kind": "folder",100 "name": "tests",101 "relpath": fix_path("./tests"),102 "parentid": ".",103 },104 {105 "id": "./tests/test_spam.py",106 "kind": "file",107 "name": "test_spam.py",108 "relpath": fix_path("./tests/test_spam.py"),109 "parentid": "./tests",110 },111 ],112 "tests": [113 {114 "id": "./tests/test_spam.py::test_simple",115 "name": "test_simple",116 "source": fix_path("./tests/test_spam.py:2"),117 "markers": [],118 "parentid": "./tests/test_spam.py",119 },120 ],121 }122 ],123 )124 def test_discover_complex_default(self):125 projroot, testroot = resolve_testroot("complex")126 expected = self.complex(projroot)127 expected[0]["tests"] = fix_test_order(expected[0]["tests"])128 if sys.version_info < (3,):129 decorated = [130 "./tests/test_unittest.py::MyTests::test_skipped",131 "./tests/test_unittest.py::MyTests::test_maybe_skipped",132 "./tests/test_unittest.py::MyTests::test_maybe_not_skipped",133 ]134 for testid in decorated:135 fix_source(expected[0]["tests"], testid, None, 0)136 out = run_adapter("discover", "pytest", "--rootdir", projroot, testroot)137 result = json.loads(out)138 result[0]["tests"] = fix_test_order(result[0]["tests"])139 self.maxDiff = None140 self.assertEqual(sorted_object(result), sorted_object(expected))141 def test_discover_complex_doctest(self):142 projroot, _ = resolve_testroot("complex")143 expected = self.complex(projroot)144 # add in doctests from test suite145 expected[0]["parents"].insert(146 3,147 {148 "id": "./tests/test_doctest.py",149 "kind": "file",150 "name": "test_doctest.py",151 "relpath": fix_path("./tests/test_doctest.py"),152 "parentid": "./tests",153 },154 )155 expected[0]["tests"].insert(156 2,157 {158 "id": "./tests/test_doctest.py::tests.test_doctest",159 "name": "tests.test_doctest",160 "source": fix_path("./tests/test_doctest.py:1"),161 "markers": [],162 "parentid": "./tests/test_doctest.py",163 },164 )165 # add in doctests from non-test module166 expected[0]["parents"].insert(167 0,168 {169 "id": "./mod.py",170 "kind": "file",171 "name": "mod.py",172 "relpath": fix_path("./mod.py"),173 "parentid": ".",174 },175 )176 expected[0]["tests"] = [177 {178 "id": "./mod.py::mod",179 "name": "mod",180 "source": fix_path("./mod.py:1"),181 "markers": [],182 "parentid": "./mod.py",183 },184 {185 "id": "./mod.py::mod.Spam",186 "name": "mod.Spam",187 "source": fix_path("./mod.py:33"),188 "markers": [],189 "parentid": "./mod.py",190 },191 {192 "id": "./mod.py::mod.Spam.eggs",193 "name": "mod.Spam.eggs",194 "source": fix_path("./mod.py:43"),195 "markers": [],196 "parentid": "./mod.py",197 },198 {199 "id": "./mod.py::mod.square",200 "name": "mod.square",201 "source": fix_path("./mod.py:18"),202 "markers": [],203 "parentid": "./mod.py",204 },205 ] + expected[0]["tests"]206 expected[0]["tests"] = fix_test_order(expected[0]["tests"])207 if sys.version_info < (3,):208 decorated = [209 "./tests/test_unittest.py::MyTests::test_skipped",210 "./tests/test_unittest.py::MyTests::test_maybe_skipped",211 "./tests/test_unittest.py::MyTests::test_maybe_not_skipped",212 ]213 for testid in decorated:214 fix_source(expected[0]["tests"], testid, None, 0)215 out = run_adapter(216 "discover", "pytest", "--rootdir", projroot, "--doctest-modules", projroot217 )218 result = json.loads(out)219 result[0]["tests"] = fix_test_order(result[0]["tests"])220 self.maxDiff = None221 self.assertEqual(sorted_object(result), sorted_object(expected))222 def test_discover_not_found(self):223 projroot, testroot = resolve_testroot("notests")224 out = run_adapter("discover", "pytest", "--rootdir", projroot, testroot)225 result = json.loads(out)226 self.maxDiff = None227 self.assertEqual(result, [])228 # TODO: Expect the following instead?229 # self.assertEqual(result, [{230 # 'root': projroot,231 # 'rootid': '.',232 # 'parents': [],233 # 'tests': [],234 # }])235 @unittest.skip("broken in CI")236 def test_discover_bad_args(self):237 projroot, testroot = resolve_testroot("simple")238 with self.assertRaises(subprocess.CalledProcessError) as cm:239 _run_adapter(240 "discover",241 "pytest",242 "--spam",243 "--rootdir",244 projroot,245 testroot,246 stderr=subprocess.STDOUT,247 )248 self.assertIn("(exit code 4)", cm.exception.output)249 def test_discover_syntax_error(self):250 projroot, testroot = resolve_testroot("syntax-error")251 with self.assertRaises(subprocess.CalledProcessError) as cm:252 _run_adapter(253 "discover",254 "pytest",255 "--rootdir",256 projroot,257 testroot,258 stderr=subprocess.STDOUT,259 )260 self.assertIn("(exit code 2)", cm.exception.output)261 def test_discover_normcase(self):262 projroot, testroot = resolve_testroot("NormCase")263 out = run_adapter("discover", "pytest", "--rootdir", projroot, testroot)264 result = json.loads(out)265 self.maxDiff = None266 self.assertTrue(projroot.endswith("NormCase"))267 self.assertEqual(268 result,269 [270 {271 "root": projroot,272 "rootid": ".",273 "parents": [274 {275 "id": "./tests",276 "kind": "folder",277 "name": "tests",278 "relpath": fix_path("./tests"),279 "parentid": ".",280 },281 {282 "id": "./tests/A",283 "kind": "folder",284 "name": "A",285 "relpath": fix_path("./tests/A"),286 "parentid": "./tests",287 },288 {289 "id": "./tests/A/b",290 "kind": "folder",291 "name": "b",292 "relpath": fix_path("./tests/A/b"),293 "parentid": "./tests/A",294 },295 {296 "id": "./tests/A/b/C",297 "kind": "folder",298 "name": "C",299 "relpath": fix_path("./tests/A/b/C"),300 "parentid": "./tests/A/b",301 },302 {303 "id": "./tests/A/b/C/test_Spam.py",304 "kind": "file",305 "name": "test_Spam.py",306 "relpath": fix_path("./tests/A/b/C/test_Spam.py"),307 "parentid": "./tests/A/b/C",308 },309 ],310 "tests": [311 {312 "id": "./tests/A/b/C/test_Spam.py::test_okay",313 "name": "test_okay",314 "source": fix_path("./tests/A/b/C/test_Spam.py:2"),315 "markers": [],316 "parentid": "./tests/A/b/C/test_Spam.py",317 },318 ],319 }320 ],321 )322COMPLEX = {323 "root": None,324 "rootid": ".",325 "parents": [326 #327 {328 "id": "./tests",329 "kind": "folder",330 "name": "tests",331 "relpath": fix_path("./tests"),332 "parentid": ".",333 },334 # +++335 {336 "id": "./tests/test_42-43.py",337 "kind": "file",338 "name": "test_42-43.py",339 "relpath": fix_path("./tests/test_42-43.py"),340 "parentid": "./tests",341 },342 # +++343 {344 "id": "./tests/test_42.py",345 "kind": "file",346 "name": "test_42.py",347 "relpath": fix_path("./tests/test_42.py"),348 "parentid": "./tests",349 },350 # +++351 {352 "id": "./tests/test_doctest.txt",353 "kind": "file",354 "name": "test_doctest.txt",355 "relpath": fix_path("./tests/test_doctest.txt"),356 "parentid": "./tests",357 },358 # +++359 {360 "id": "./tests/test_foo.py",361 "kind": "file",362 "name": "test_foo.py",363 "relpath": fix_path("./tests/test_foo.py"),364 "parentid": "./tests",365 },366 # +++367 {368 "id": "./tests/test_mixed.py",369 "kind": "file",370 "name": "test_mixed.py",371 "relpath": fix_path("./tests/test_mixed.py"),372 "parentid": "./tests",373 },374 {375 "id": "./tests/test_mixed.py::MyTests",376 "kind": "suite",377 "name": "MyTests",378 "parentid": "./tests/test_mixed.py",379 },380 {381 "id": "./tests/test_mixed.py::TestMySuite",382 "kind": "suite",383 "name": "TestMySuite",384 "parentid": "./tests/test_mixed.py",385 },386 # +++387 {388 "id": "./tests/test_pytest.py",389 "kind": "file",390 "name": "test_pytest.py",391 "relpath": fix_path("./tests/test_pytest.py"),392 "parentid": "./tests",393 },394 {395 "id": "./tests/test_pytest.py::TestEggs",396 "kind": "suite",397 "name": "TestEggs",398 "parentid": "./tests/test_pytest.py",399 },400 {401 "id": "./tests/test_pytest.py::TestParam",402 "kind": "suite",403 "name": "TestParam",404 "parentid": "./tests/test_pytest.py",405 },406 {407 "id": "./tests/test_pytest.py::TestParam::test_param_13",408 "kind": "function",409 "name": "test_param_13",410 "parentid": "./tests/test_pytest.py::TestParam",411 },412 {413 "id": "./tests/test_pytest.py::TestParamAll",414 "kind": "suite",415 "name": "TestParamAll",416 "parentid": "./tests/test_pytest.py",417 },418 {419 "id": "./tests/test_pytest.py::TestParamAll::test_param_13",420 "kind": "function",421 "name": "test_param_13",422 "parentid": "./tests/test_pytest.py::TestParamAll",423 },424 {425 "id": "./tests/test_pytest.py::TestParamAll::test_spam_13",426 "kind": "function",427 "name": "test_spam_13",428 "parentid": "./tests/test_pytest.py::TestParamAll",429 },430 {431 "id": "./tests/test_pytest.py::TestSpam",432 "kind": "suite",433 "name": "TestSpam",434 "parentid": "./tests/test_pytest.py",435 },436 {437 "id": "./tests/test_pytest.py::TestSpam::TestHam",438 "kind": "suite",439 "name": "TestHam",440 "parentid": "./tests/test_pytest.py::TestSpam",441 },442 {443 "id": "./tests/test_pytest.py::TestSpam::TestHam::TestEggs",444 "kind": "suite",445 "name": "TestEggs",446 "parentid": "./tests/test_pytest.py::TestSpam::TestHam",447 },448 {449 "id": "./tests/test_pytest.py::test_fixture_param",450 "kind": "function",451 "name": "test_fixture_param",452 "parentid": "./tests/test_pytest.py",453 },454 {455 "id": "./tests/test_pytest.py::test_param_01",456 "kind": "function",457 "name": "test_param_01",458 "parentid": "./tests/test_pytest.py",459 },460 {461 "id": "./tests/test_pytest.py::test_param_11",462 "kind": "function",463 "name": "test_param_11",464 "parentid": "./tests/test_pytest.py",465 },466 {467 "id": "./tests/test_pytest.py::test_param_13",468 "kind": "function",469 "name": "test_param_13",470 "parentid": "./tests/test_pytest.py",471 },472 {473 "id": "./tests/test_pytest.py::test_param_13_markers",474 "kind": "function",475 "name": "test_param_13_markers",476 "parentid": "./tests/test_pytest.py",477 },478 {479 "id": "./tests/test_pytest.py::test_param_13_repeat",480 "kind": "function",481 "name": "test_param_13_repeat",482 "parentid": "./tests/test_pytest.py",483 },484 {485 "id": "./tests/test_pytest.py::test_param_13_skipped",486 "kind": "function",487 "name": "test_param_13_skipped",488 "parentid": "./tests/test_pytest.py",489 },490 {491 "id": "./tests/test_pytest.py::test_param_23_13",492 "kind": "function",493 "name": "test_param_23_13",494 "parentid": "./tests/test_pytest.py",495 },496 {497 "id": "./tests/test_pytest.py::test_param_23_raises",498 "kind": "function",499 "name": "test_param_23_raises",500 "parentid": "./tests/test_pytest.py",501 },502 {503 "id": "./tests/test_pytest.py::test_param_33",504 "kind": "function",505 "name": "test_param_33",506 "parentid": "./tests/test_pytest.py",507 },508 {509 "id": "./tests/test_pytest.py::test_param_33_ids",510 "kind": "function",511 "name": "test_param_33_ids",512 "parentid": "./tests/test_pytest.py",513 },514 {515 "id": "./tests/test_pytest.py::test_param_fixture",516 "kind": "function",517 "name": "test_param_fixture",518 "parentid": "./tests/test_pytest.py",519 },520 {521 "id": "./tests/test_pytest.py::test_param_mark_fixture",522 "kind": "function",523 "name": "test_param_mark_fixture",524 "parentid": "./tests/test_pytest.py",525 },526 # +++527 {528 "id": "./tests/test_pytest_param.py",529 "kind": "file",530 "name": "test_pytest_param.py",531 "relpath": fix_path("./tests/test_pytest_param.py"),532 "parentid": "./tests",533 },534 {535 "id": "./tests/test_pytest_param.py::TestParamAll",536 "kind": "suite",537 "name": "TestParamAll",538 "parentid": "./tests/test_pytest_param.py",539 },540 {541 "id": "./tests/test_pytest_param.py::TestParamAll::test_param_13",542 "kind": "function",543 "name": "test_param_13",544 "parentid": "./tests/test_pytest_param.py::TestParamAll",545 },546 {547 "id": "./tests/test_pytest_param.py::TestParamAll::test_spam_13",548 "kind": "function",549 "name": "test_spam_13",550 "parentid": "./tests/test_pytest_param.py::TestParamAll",551 },552 {553 "id": "./tests/test_pytest_param.py::test_param_13",554 "kind": "function",555 "name": "test_param_13",556 "parentid": "./tests/test_pytest_param.py",557 },558 # +++559 {560 "id": "./tests/test_unittest.py",561 "kind": "file",562 "name": "test_unittest.py",563 "relpath": fix_path("./tests/test_unittest.py"),564 "parentid": "./tests",565 },566 {567 "id": "./tests/test_unittest.py::MyTests",568 "kind": "suite",569 "name": "MyTests",570 "parentid": "./tests/test_unittest.py",571 },572 {573 "id": "./tests/test_unittest.py::OtherTests",574 "kind": "suite",575 "name": "OtherTests",576 "parentid": "./tests/test_unittest.py",577 },578 ##579 {580 "id": "./tests/v",581 "kind": "folder",582 "name": "v",583 "relpath": fix_path("./tests/v"),584 "parentid": "./tests",585 },586 ## +++587 {588 "id": "./tests/v/test_eggs.py",589 "kind": "file",590 "name": "test_eggs.py",591 "relpath": fix_path("./tests/v/test_eggs.py"),592 "parentid": "./tests/v",593 },594 {595 "id": "./tests/v/test_eggs.py::TestSimple",596 "kind": "suite",597 "name": "TestSimple",598 "parentid": "./tests/v/test_eggs.py",599 },600 ## +++601 {602 "id": "./tests/v/test_ham.py",603 "kind": "file",604 "name": "test_ham.py",605 "relpath": fix_path("./tests/v/test_ham.py"),606 "parentid": "./tests/v",607 },608 ## +++609 {610 "id": "./tests/v/test_spam.py",611 "kind": "file",612 "name": "test_spam.py",613 "relpath": fix_path("./tests/v/test_spam.py"),614 "parentid": "./tests/v",615 },616 ##617 {618 "id": "./tests/w",619 "kind": "folder",620 "name": "w",621 "relpath": fix_path("./tests/w"),622 "parentid": "./tests",623 },624 ## +++625 {626 "id": "./tests/w/test_spam.py",627 "kind": "file",628 "name": "test_spam.py",629 "relpath": fix_path("./tests/w/test_spam.py"),630 "parentid": "./tests/w",631 },632 ## +++633 {634 "id": "./tests/w/test_spam_ex.py",635 "kind": "file",636 "name": "test_spam_ex.py",637 "relpath": fix_path("./tests/w/test_spam_ex.py"),638 "parentid": "./tests/w",639 },640 ##641 {642 "id": "./tests/x",643 "kind": "folder",644 "name": "x",645 "relpath": fix_path("./tests/x"),646 "parentid": "./tests",647 },648 ###649 {650 "id": "./tests/x/y",651 "kind": "folder",652 "name": "y",653 "relpath": fix_path("./tests/x/y"),654 "parentid": "./tests/x",655 },656 ####657 {658 "id": "./tests/x/y/z",659 "kind": "folder",660 "name": "z",661 "relpath": fix_path("./tests/x/y/z"),662 "parentid": "./tests/x/y",663 },664 #####665 {666 "id": "./tests/x/y/z/a",667 "kind": "folder",668 "name": "a",669 "relpath": fix_path("./tests/x/y/z/a"),670 "parentid": "./tests/x/y/z",671 },672 ##### +++673 {674 "id": "./tests/x/y/z/a/test_spam.py",675 "kind": "file",676 "name": "test_spam.py",677 "relpath": fix_path("./tests/x/y/z/a/test_spam.py"),678 "parentid": "./tests/x/y/z/a",679 },680 #####681 {682 "id": "./tests/x/y/z/b",683 "kind": "folder",684 "name": "b",685 "relpath": fix_path("./tests/x/y/z/b"),686 "parentid": "./tests/x/y/z",687 },688 ##### +++689 {690 "id": "./tests/x/y/z/b/test_spam.py",691 "kind": "file",692 "name": "test_spam.py",693 "relpath": fix_path("./tests/x/y/z/b/test_spam.py"),694 "parentid": "./tests/x/y/z/b",695 },696 #### +++697 {698 "id": "./tests/x/y/z/test_ham.py",699 "kind": "file",700 "name": "test_ham.py",701 "relpath": fix_path("./tests/x/y/z/test_ham.py"),702 "parentid": "./tests/x/y/z",703 },704 ],705 "tests": [706 ##########707 {708 "id": "./tests/test_42-43.py::test_simple",709 "name": "test_simple",710 "source": fix_path("./tests/test_42-43.py:2"),711 "markers": [],712 "parentid": "./tests/test_42-43.py",713 },714 #####715 {716 "id": "./tests/test_42.py::test_simple",717 "name": "test_simple",718 "source": fix_path("./tests/test_42.py:2"),719 "markers": [],720 "parentid": "./tests/test_42.py",721 },722 #####723 {724 "id": "./tests/test_doctest.txt::test_doctest.txt",725 "name": "test_doctest.txt",726 "source": fix_path("./tests/test_doctest.txt:1"),727 "markers": [],728 "parentid": "./tests/test_doctest.txt",729 },730 #####731 {732 "id": "./tests/test_foo.py::test_simple",733 "name": "test_simple",734 "source": fix_path("./tests/test_foo.py:3"),735 "markers": [],736 "parentid": "./tests/test_foo.py",737 },738 #####739 {740 "id": "./tests/test_mixed.py::test_top_level",741 "name": "test_top_level",742 "source": fix_path("./tests/test_mixed.py:5"),743 "markers": [],744 "parentid": "./tests/test_mixed.py",745 },746 {747 "id": "./tests/test_mixed.py::test_skipped",748 "name": "test_skipped",749 "source": fix_path("./tests/test_mixed.py:9"),750 "markers": ["skip"],751 "parentid": "./tests/test_mixed.py",752 },753 {754 "id": "./tests/test_mixed.py::TestMySuite::test_simple",755 "name": "test_simple",756 "source": fix_path("./tests/test_mixed.py:16"),757 "markers": [],758 "parentid": "./tests/test_mixed.py::TestMySuite",759 },760 {761 "id": "./tests/test_mixed.py::MyTests::test_simple",762 "name": "test_simple",763 "source": fix_path("./tests/test_mixed.py:22"),764 "markers": [],765 "parentid": "./tests/test_mixed.py::MyTests",766 },767 {768 "id": "./tests/test_mixed.py::MyTests::test_skipped",769 "name": "test_skipped",770 "source": fix_path("./tests/test_mixed.py:25"),771 "markers": ["skip"],772 "parentid": "./tests/test_mixed.py::MyTests",773 },774 #####775 {776 "id": "./tests/test_pytest.py::test_simple",777 "name": "test_simple",778 "source": fix_path("./tests/test_pytest.py:6"),779 "markers": [],780 "parentid": "./tests/test_pytest.py",781 },782 {783 "id": "./tests/test_pytest.py::test_failure",784 "name": "test_failure",785 "source": fix_path("./tests/test_pytest.py:10"),786 "markers": [],787 "parentid": "./tests/test_pytest.py",788 },789 {790 "id": "./tests/test_pytest.py::test_runtime_skipped",791 "name": "test_runtime_skipped",792 "source": fix_path("./tests/test_pytest.py:14"),793 "markers": [],794 "parentid": "./tests/test_pytest.py",795 },796 {797 "id": "./tests/test_pytest.py::test_runtime_failed",798 "name": "test_runtime_failed",799 "source": fix_path("./tests/test_pytest.py:18"),800 "markers": [],801 "parentid": "./tests/test_pytest.py",802 },803 {804 "id": "./tests/test_pytest.py::test_raises",805 "name": "test_raises",806 "source": fix_path("./tests/test_pytest.py:22"),807 "markers": [],808 "parentid": "./tests/test_pytest.py",809 },810 {811 "id": "./tests/test_pytest.py::test_skipped",812 "name": "test_skipped",813 "source": fix_path("./tests/test_pytest.py:26"),814 "markers": ["skip"],815 "parentid": "./tests/test_pytest.py",816 },817 {818 "id": "./tests/test_pytest.py::test_maybe_skipped",819 "name": "test_maybe_skipped",820 "source": fix_path("./tests/test_pytest.py:31"),821 "markers": ["skip-if"],822 "parentid": "./tests/test_pytest.py",823 },824 {825 "id": "./tests/test_pytest.py::test_known_failure",826 "name": "test_known_failure",827 "source": fix_path("./tests/test_pytest.py:36"),828 "markers": ["expected-failure"],829 "parentid": "./tests/test_pytest.py",830 },831 {832 "id": "./tests/test_pytest.py::test_warned",833 "name": "test_warned",834 "source": fix_path("./tests/test_pytest.py:41"),835 "markers": [],836 "parentid": "./tests/test_pytest.py",837 },838 {839 "id": "./tests/test_pytest.py::test_custom_marker",840 "name": "test_custom_marker",841 "source": fix_path("./tests/test_pytest.py:46"),842 "markers": [],843 "parentid": "./tests/test_pytest.py",844 },845 {846 "id": "./tests/test_pytest.py::test_multiple_markers",847 "name": "test_multiple_markers",848 "source": fix_path("./tests/test_pytest.py:51"),849 "markers": ["expected-failure", "skip", "skip-if"],850 "parentid": "./tests/test_pytest.py",851 },852 {853 "id": "./tests/test_pytest.py::test_dynamic_1",854 "name": "test_dynamic_1",855 "source": fix_path("./tests/test_pytest.py:62"),856 "markers": [],857 "parentid": "./tests/test_pytest.py",858 },859 {860 "id": "./tests/test_pytest.py::test_dynamic_2",861 "name": "test_dynamic_2",862 "source": fix_path("./tests/test_pytest.py:62"),863 "markers": [],864 "parentid": "./tests/test_pytest.py",865 },866 {867 "id": "./tests/test_pytest.py::test_dynamic_3",868 "name": "test_dynamic_3",869 "source": fix_path("./tests/test_pytest.py:62"),870 "markers": [],871 "parentid": "./tests/test_pytest.py",872 },873 {874 "id": "./tests/test_pytest.py::TestSpam::test_simple",875 "name": "test_simple",876 "source": fix_path("./tests/test_pytest.py:70"),877 "markers": [],878 "parentid": "./tests/test_pytest.py::TestSpam",879 },880 {881 "id": "./tests/test_pytest.py::TestSpam::test_skipped",882 "name": "test_skipped",883 "source": fix_path("./tests/test_pytest.py:73"),884 "markers": ["skip"],885 "parentid": "./tests/test_pytest.py::TestSpam",886 },887 {888 "id": "./tests/test_pytest.py::TestSpam::TestHam::TestEggs::test_simple",889 "name": "test_simple",890 "source": fix_path("./tests/test_pytest.py:81"),891 "markers": [],892 "parentid": "./tests/test_pytest.py::TestSpam::TestHam::TestEggs",893 },894 {895 "id": "./tests/test_pytest.py::TestEggs::test_simple",896 "name": "test_simple",897 "source": fix_path("./tests/test_pytest.py:93"),898 "markers": [],899 "parentid": "./tests/test_pytest.py::TestEggs",900 },901 {902 "id": "./tests/test_pytest.py::test_param_01[]",903 "name": "test_param_01[]",904 "source": fix_path("./tests/test_pytest.py:103"),905 "markers": [],906 "parentid": "./tests/test_pytest.py::test_param_01",907 },908 {909 "id": "./tests/test_pytest.py::test_param_11[x0]",910 "name": "test_param_11[x0]",911 "source": fix_path("./tests/test_pytest.py:108"),912 "markers": [],913 "parentid": "./tests/test_pytest.py::test_param_11",914 },915 {916 "id": "./tests/test_pytest.py::test_param_13[x0]",917 "name": "test_param_13[x0]",918 "source": fix_path("./tests/test_pytest.py:113"),919 "markers": [],920 "parentid": "./tests/test_pytest.py::test_param_13",921 },922 {923 "id": "./tests/test_pytest.py::test_param_13[x1]",924 "name": "test_param_13[x1]",925 "source": fix_path("./tests/test_pytest.py:113"),926 "markers": [],927 "parentid": "./tests/test_pytest.py::test_param_13",928 },929 {930 "id": "./tests/test_pytest.py::test_param_13[x2]",931 "name": "test_param_13[x2]",932 "source": fix_path("./tests/test_pytest.py:113"),933 "markers": [],934 "parentid": "./tests/test_pytest.py::test_param_13",935 },936 {937 "id": "./tests/test_pytest.py::test_param_13_repeat[x0]",938 "name": "test_param_13_repeat[x0]",939 "source": fix_path("./tests/test_pytest.py:118"),940 "markers": [],941 "parentid": "./tests/test_pytest.py::test_param_13_repeat",942 },943 {944 "id": "./tests/test_pytest.py::test_param_13_repeat[x1]",945 "name": "test_param_13_repeat[x1]",946 "source": fix_path("./tests/test_pytest.py:118"),947 "markers": [],948 "parentid": "./tests/test_pytest.py::test_param_13_repeat",949 },950 {951 "id": "./tests/test_pytest.py::test_param_13_repeat[x2]",952 "name": "test_param_13_repeat[x2]",953 "source": fix_path("./tests/test_pytest.py:118"),954 "markers": [],955 "parentid": "./tests/test_pytest.py::test_param_13_repeat",956 },957 {958 "id": "./tests/test_pytest.py::test_param_33[1-1-1]",959 "name": "test_param_33[1-1-1]",960 "source": fix_path("./tests/test_pytest.py:123"),961 "markers": [],962 "parentid": "./tests/test_pytest.py::test_param_33",963 },964 {965 "id": "./tests/test_pytest.py::test_param_33[3-4-5]",966 "name": "test_param_33[3-4-5]",967 "source": fix_path("./tests/test_pytest.py:123"),968 "markers": [],969 "parentid": "./tests/test_pytest.py::test_param_33",970 },971 {972 "id": "./tests/test_pytest.py::test_param_33[0-0-0]",973 "name": "test_param_33[0-0-0]",974 "source": fix_path("./tests/test_pytest.py:123"),975 "markers": [],976 "parentid": "./tests/test_pytest.py::test_param_33",977 },978 {979 "id": "./tests/test_pytest.py::test_param_33_ids[v1]",980 "name": "test_param_33_ids[v1]",981 "source": fix_path("./tests/test_pytest.py:128"),982 "markers": [],983 "parentid": "./tests/test_pytest.py::test_param_33_ids",984 },985 {986 "id": "./tests/test_pytest.py::test_param_33_ids[v2]",987 "name": "test_param_33_ids[v2]",988 "source": fix_path("./tests/test_pytest.py:128"),989 "markers": [],990 "parentid": "./tests/test_pytest.py::test_param_33_ids",991 },992 {993 "id": "./tests/test_pytest.py::test_param_33_ids[v3]",994 "name": "test_param_33_ids[v3]",995 "source": fix_path("./tests/test_pytest.py:128"),996 "markers": [],997 "parentid": "./tests/test_pytest.py::test_param_33_ids",998 },999 {1000 "id": "./tests/test_pytest.py::test_param_23_13[1-1-z0]",1001 "name": "test_param_23_13[1-1-z0]",1002 "source": fix_path("./tests/test_pytest.py:134"),1003 "markers": [],1004 "parentid": "./tests/test_pytest.py::test_param_23_13",1005 },1006 {1007 "id": "./tests/test_pytest.py::test_param_23_13[1-1-z1]",1008 "name": "test_param_23_13[1-1-z1]",1009 "source": fix_path("./tests/test_pytest.py:134"),1010 "markers": [],1011 "parentid": "./tests/test_pytest.py::test_param_23_13",1012 },1013 {1014 "id": "./tests/test_pytest.py::test_param_23_13[1-1-z2]",1015 "name": "test_param_23_13[1-1-z2]",1016 "source": fix_path("./tests/test_pytest.py:134"),1017 "markers": [],1018 "parentid": "./tests/test_pytest.py::test_param_23_13",1019 },1020 {1021 "id": "./tests/test_pytest.py::test_param_23_13[3-4-z0]",1022 "name": "test_param_23_13[3-4-z0]",1023 "source": fix_path("./tests/test_pytest.py:134"),1024 "markers": [],1025 "parentid": "./tests/test_pytest.py::test_param_23_13",1026 },1027 {1028 "id": "./tests/test_pytest.py::test_param_23_13[3-4-z1]",1029 "name": "test_param_23_13[3-4-z1]",1030 "source": fix_path("./tests/test_pytest.py:134"),1031 "markers": [],1032 "parentid": "./tests/test_pytest.py::test_param_23_13",1033 },1034 {1035 "id": "./tests/test_pytest.py::test_param_23_13[3-4-z2]",1036 "name": "test_param_23_13[3-4-z2]",1037 "source": fix_path("./tests/test_pytest.py:134"),1038 "markers": [],1039 "parentid": "./tests/test_pytest.py::test_param_23_13",1040 },1041 {1042 "id": "./tests/test_pytest.py::test_param_23_13[0-0-z0]",1043 "name": "test_param_23_13[0-0-z0]",1044 "source": fix_path("./tests/test_pytest.py:134"),1045 "markers": [],1046 "parentid": "./tests/test_pytest.py::test_param_23_13",1047 },1048 {1049 "id": "./tests/test_pytest.py::test_param_23_13[0-0-z1]",1050 "name": "test_param_23_13[0-0-z1]",1051 "source": fix_path("./tests/test_pytest.py:134"),1052 "markers": [],1053 "parentid": "./tests/test_pytest.py::test_param_23_13",1054 },1055 {1056 "id": "./tests/test_pytest.py::test_param_23_13[0-0-z2]",1057 "name": "test_param_23_13[0-0-z2]",1058 "source": fix_path("./tests/test_pytest.py:134"),1059 "markers": [],1060 "parentid": "./tests/test_pytest.py::test_param_23_13",1061 },1062 {1063 "id": "./tests/test_pytest.py::test_param_13_markers[x0]",1064 "name": "test_param_13_markers[x0]",1065 "source": fix_path("./tests/test_pytest.py:140"),1066 "markers": [],1067 "parentid": "./tests/test_pytest.py::test_param_13_markers",1068 },1069 {1070 "id": "./tests/test_pytest.py::test_param_13_markers[???]",1071 "name": "test_param_13_markers[???]",1072 "source": fix_path("./tests/test_pytest.py:140"),1073 "markers": ["skip"],1074 "parentid": "./tests/test_pytest.py::test_param_13_markers",1075 },1076 {1077 "id": "./tests/test_pytest.py::test_param_13_markers[2]",1078 "name": "test_param_13_markers[2]",1079 "source": fix_path("./tests/test_pytest.py:140"),1080 "markers": ["expected-failure"],1081 "parentid": "./tests/test_pytest.py::test_param_13_markers",1082 },1083 {1084 "id": "./tests/test_pytest.py::test_param_13_skipped[x0]",1085 "name": "test_param_13_skipped[x0]",1086 "source": fix_path("./tests/test_pytest.py:149"),1087 "markers": ["skip"],1088 "parentid": "./tests/test_pytest.py::test_param_13_skipped",1089 },1090 {1091 "id": "./tests/test_pytest.py::test_param_13_skipped[x1]",1092 "name": "test_param_13_skipped[x1]",1093 "source": fix_path("./tests/test_pytest.py:149"),1094 "markers": ["skip"],1095 "parentid": "./tests/test_pytest.py::test_param_13_skipped",1096 },1097 {1098 "id": "./tests/test_pytest.py::test_param_13_skipped[x2]",1099 "name": "test_param_13_skipped[x2]",1100 "source": fix_path("./tests/test_pytest.py:149"),1101 "markers": ["skip"],1102 "parentid": "./tests/test_pytest.py::test_param_13_skipped",1103 },1104 {1105 "id": "./tests/test_pytest.py::test_param_23_raises[1-None]",1106 "name": "test_param_23_raises[1-None]",1107 "source": fix_path("./tests/test_pytest.py:155"),1108 "markers": [],1109 "parentid": "./tests/test_pytest.py::test_param_23_raises",1110 },1111 {1112 "id": "./tests/test_pytest.py::test_param_23_raises[1.0-None]",1113 "name": "test_param_23_raises[1.0-None]",1114 "source": fix_path("./tests/test_pytest.py:155"),1115 "markers": [],1116 "parentid": "./tests/test_pytest.py::test_param_23_raises",1117 },1118 {1119 "id": "./tests/test_pytest.py::test_param_23_raises[2-catch2]",1120 "name": "test_param_23_raises[2-catch2]",1121 "source": fix_path("./tests/test_pytest.py:155"),1122 "markers": [],1123 "parentid": "./tests/test_pytest.py::test_param_23_raises",1124 },1125 {1126 "id": "./tests/test_pytest.py::TestParam::test_simple",1127 "name": "test_simple",1128 "source": fix_path("./tests/test_pytest.py:164"),1129 "markers": [],1130 "parentid": "./tests/test_pytest.py::TestParam",1131 },1132 {1133 "id": "./tests/test_pytest.py::TestParam::test_param_13[x0]",1134 "name": "test_param_13[x0]",1135 "source": fix_path("./tests/test_pytest.py:167"),1136 "markers": [],1137 "parentid": "./tests/test_pytest.py::TestParam::test_param_13",1138 },1139 {1140 "id": "./tests/test_pytest.py::TestParam::test_param_13[x1]",1141 "name": "test_param_13[x1]",1142 "source": fix_path("./tests/test_pytest.py:167"),1143 "markers": [],1144 "parentid": "./tests/test_pytest.py::TestParam::test_param_13",1145 },1146 {1147 "id": "./tests/test_pytest.py::TestParam::test_param_13[x2]",1148 "name": "test_param_13[x2]",1149 "source": fix_path("./tests/test_pytest.py:167"),1150 "markers": [],1151 "parentid": "./tests/test_pytest.py::TestParam::test_param_13",1152 },1153 {1154 "id": "./tests/test_pytest.py::TestParamAll::test_param_13[x0]",1155 "name": "test_param_13[x0]",1156 "source": fix_path("./tests/test_pytest.py:175"),1157 "markers": [],1158 "parentid": "./tests/test_pytest.py::TestParamAll::test_param_13",1159 },1160 {1161 "id": "./tests/test_pytest.py::TestParamAll::test_param_13[x1]",1162 "name": "test_param_13[x1]",1163 "source": fix_path("./tests/test_pytest.py:175"),1164 "markers": [],1165 "parentid": "./tests/test_pytest.py::TestParamAll::test_param_13",1166 },1167 {1168 "id": "./tests/test_pytest.py::TestParamAll::test_param_13[x2]",1169 "name": "test_param_13[x2]",1170 "source": fix_path("./tests/test_pytest.py:175"),1171 "markers": [],1172 "parentid": "./tests/test_pytest.py::TestParamAll::test_param_13",1173 },1174 {1175 "id": "./tests/test_pytest.py::TestParamAll::test_spam_13[x0]",1176 "name": "test_spam_13[x0]",1177 "source": fix_path("./tests/test_pytest.py:178"),1178 "markers": [],1179 "parentid": "./tests/test_pytest.py::TestParamAll::test_spam_13",1180 },1181 {1182 "id": "./tests/test_pytest.py::TestParamAll::test_spam_13[x1]",1183 "name": "test_spam_13[x1]",1184 "source": fix_path("./tests/test_pytest.py:178"),1185 "markers": [],1186 "parentid": "./tests/test_pytest.py::TestParamAll::test_spam_13",1187 },1188 {1189 "id": "./tests/test_pytest.py::TestParamAll::test_spam_13[x2]",1190 "name": "test_spam_13[x2]",1191 "source": fix_path("./tests/test_pytest.py:178"),1192 "markers": [],1193 "parentid": "./tests/test_pytest.py::TestParamAll::test_spam_13",1194 },1195 {1196 "id": "./tests/test_pytest.py::test_fixture",1197 "name": "test_fixture",1198 "source": fix_path("./tests/test_pytest.py:192"),1199 "markers": [],1200 "parentid": "./tests/test_pytest.py",1201 },1202 {1203 "id": "./tests/test_pytest.py::test_mark_fixture",1204 "name": "test_mark_fixture",1205 "source": fix_path("./tests/test_pytest.py:196"),1206 "markers": [],1207 "parentid": "./tests/test_pytest.py",1208 },1209 {1210 "id": "./tests/test_pytest.py::test_param_fixture[x0]",1211 "name": "test_param_fixture[x0]",1212 "source": fix_path("./tests/test_pytest.py:201"),1213 "markers": [],1214 "parentid": "./tests/test_pytest.py::test_param_fixture",1215 },1216 {1217 "id": "./tests/test_pytest.py::test_param_fixture[x1]",1218 "name": "test_param_fixture[x1]",1219 "source": fix_path("./tests/test_pytest.py:201"),1220 "markers": [],1221 "parentid": "./tests/test_pytest.py::test_param_fixture",1222 },1223 {1224 "id": "./tests/test_pytest.py::test_param_fixture[x2]",1225 "name": "test_param_fixture[x2]",1226 "source": fix_path("./tests/test_pytest.py:201"),1227 "markers": [],1228 "parentid": "./tests/test_pytest.py::test_param_fixture",1229 },1230 {1231 "id": "./tests/test_pytest.py::test_param_mark_fixture[x0]",1232 "name": "test_param_mark_fixture[x0]",1233 "source": fix_path("./tests/test_pytest.py:207"),1234 "markers": [],1235 "parentid": "./tests/test_pytest.py::test_param_mark_fixture",1236 },1237 {1238 "id": "./tests/test_pytest.py::test_param_mark_fixture[x1]",1239 "name": "test_param_mark_fixture[x1]",1240 "source": fix_path("./tests/test_pytest.py:207"),1241 "markers": [],1242 "parentid": "./tests/test_pytest.py::test_param_mark_fixture",1243 },1244 {1245 "id": "./tests/test_pytest.py::test_param_mark_fixture[x2]",1246 "name": "test_param_mark_fixture[x2]",1247 "source": fix_path("./tests/test_pytest.py:207"),1248 "markers": [],1249 "parentid": "./tests/test_pytest.py::test_param_mark_fixture",1250 },1251 {1252 "id": "./tests/test_pytest.py::test_fixture_param[spam]",1253 "name": "test_fixture_param[spam]",1254 "source": fix_path("./tests/test_pytest.py:216"),1255 "markers": [],1256 "parentid": "./tests/test_pytest.py::test_fixture_param",1257 },1258 {1259 "id": "./tests/test_pytest.py::test_fixture_param[eggs]",1260 "name": "test_fixture_param[eggs]",1261 "source": fix_path("./tests/test_pytest.py:216"),1262 "markers": [],1263 "parentid": "./tests/test_pytest.py::test_fixture_param",1264 },1265 ######1266 {1267 "id": "./tests/test_pytest_param.py::test_param_13[x0]",1268 "name": "test_param_13[x0]",1269 "source": fix_path("./tests/test_pytest_param.py:8"),1270 "markers": [],1271 "parentid": "./tests/test_pytest_param.py::test_param_13",1272 },1273 {1274 "id": "./tests/test_pytest_param.py::test_param_13[x1]",1275 "name": "test_param_13[x1]",1276 "source": fix_path("./tests/test_pytest_param.py:8"),1277 "markers": [],1278 "parentid": "./tests/test_pytest_param.py::test_param_13",1279 },1280 {1281 "id": "./tests/test_pytest_param.py::test_param_13[x2]",1282 "name": "test_param_13[x2]",1283 "source": fix_path("./tests/test_pytest_param.py:8"),1284 "markers": [],1285 "parentid": "./tests/test_pytest_param.py::test_param_13",1286 },1287 {1288 "id": "./tests/test_pytest_param.py::TestParamAll::test_param_13[x0]",1289 "name": "test_param_13[x0]",1290 "source": fix_path("./tests/test_pytest_param.py:14"),1291 "markers": [],1292 "parentid": "./tests/test_pytest_param.py::TestParamAll::test_param_13",1293 },1294 {1295 "id": "./tests/test_pytest_param.py::TestParamAll::test_param_13[x1]",1296 "name": "test_param_13[x1]",1297 "source": fix_path("./tests/test_pytest_param.py:14"),1298 "markers": [],1299 "parentid": "./tests/test_pytest_param.py::TestParamAll::test_param_13",1300 },1301 {1302 "id": "./tests/test_pytest_param.py::TestParamAll::test_param_13[x2]",1303 "name": "test_param_13[x2]",1304 "source": fix_path("./tests/test_pytest_param.py:14"),1305 "markers": [],1306 "parentid": "./tests/test_pytest_param.py::TestParamAll::test_param_13",1307 },1308 {1309 "id": "./tests/test_pytest_param.py::TestParamAll::test_spam_13[x0]",1310 "name": "test_spam_13[x0]",1311 "source": fix_path("./tests/test_pytest_param.py:17"),1312 "markers": [],1313 "parentid": "./tests/test_pytest_param.py::TestParamAll::test_spam_13",1314 },1315 {1316 "id": "./tests/test_pytest_param.py::TestParamAll::test_spam_13[x1]",1317 "name": "test_spam_13[x1]",1318 "source": fix_path("./tests/test_pytest_param.py:17"),1319 "markers": [],1320 "parentid": "./tests/test_pytest_param.py::TestParamAll::test_spam_13",1321 },1322 {1323 "id": "./tests/test_pytest_param.py::TestParamAll::test_spam_13[x2]",1324 "name": "test_spam_13[x2]",1325 "source": fix_path("./tests/test_pytest_param.py:17"),1326 "markers": [],1327 "parentid": "./tests/test_pytest_param.py::TestParamAll::test_spam_13",1328 },1329 ######1330 {1331 "id": "./tests/test_unittest.py::MyTests::test_dynamic_",1332 "name": "test_dynamic_",1333 "source": fix_path("./tests/test_unittest.py:54"),1334 "markers": [],1335 "parentid": "./tests/test_unittest.py::MyTests",1336 },1337 {1338 "id": "./tests/test_unittest.py::MyTests::test_failure",1339 "name": "test_failure",1340 "source": fix_path("./tests/test_unittest.py:34"),1341 "markers": [],1342 "parentid": "./tests/test_unittest.py::MyTests",1343 },1344 {1345 "id": "./tests/test_unittest.py::MyTests::test_known_failure",1346 "name": "test_known_failure",1347 "source": fix_path("./tests/test_unittest.py:37"),1348 "markers": [],1349 "parentid": "./tests/test_unittest.py::MyTests",1350 },1351 {1352 "id": "./tests/test_unittest.py::MyTests::test_maybe_not_skipped",1353 "name": "test_maybe_not_skipped",1354 "source": fix_path("./tests/test_unittest.py:17"),1355 "markers": [],1356 "parentid": "./tests/test_unittest.py::MyTests",1357 },1358 {1359 "id": "./tests/test_unittest.py::MyTests::test_maybe_skipped",1360 "name": "test_maybe_skipped",1361 "source": fix_path("./tests/test_unittest.py:13"),1362 "markers": [],1363 "parentid": "./tests/test_unittest.py::MyTests",1364 },1365 {1366 "id": "./tests/test_unittest.py::MyTests::test_simple",1367 "name": "test_simple",1368 "source": fix_path("./tests/test_unittest.py:6"),1369 "markers": [],1370 "parentid": "./tests/test_unittest.py::MyTests",1371 },1372 {1373 "id": "./tests/test_unittest.py::MyTests::test_skipped",1374 "name": "test_skipped",1375 "source": fix_path("./tests/test_unittest.py:9"),1376 "markers": [],1377 "parentid": "./tests/test_unittest.py::MyTests",1378 },1379 {1380 "id": "./tests/test_unittest.py::MyTests::test_skipped_inside",1381 "name": "test_skipped_inside",1382 "source": fix_path("./tests/test_unittest.py:21"),1383 "markers": [],1384 "parentid": "./tests/test_unittest.py::MyTests",1385 },1386 {1387 "id": "./tests/test_unittest.py::MyTests::test_with_nested_subtests",1388 "name": "test_with_nested_subtests",1389 "source": fix_path("./tests/test_unittest.py:46"),1390 "markers": [],1391 "parentid": "./tests/test_unittest.py::MyTests",1392 },1393 {1394 "id": "./tests/test_unittest.py::MyTests::test_with_subtests",1395 "name": "test_with_subtests",1396 "source": fix_path("./tests/test_unittest.py:41"),1397 "markers": [],1398 "parentid": "./tests/test_unittest.py::MyTests",1399 },1400 {1401 "id": "./tests/test_unittest.py::OtherTests::test_simple",1402 "name": "test_simple",1403 "source": fix_path("./tests/test_unittest.py:61"),1404 "markers": [],1405 "parentid": "./tests/test_unittest.py::OtherTests",1406 },1407 ###########1408 {1409 "id": "./tests/v/test_eggs.py::test_simple",1410 "name": "test_simple",1411 "source": fix_path("./tests/v/spam.py:2"),1412 "markers": [],1413 "parentid": "./tests/v/test_eggs.py",1414 },1415 {1416 "id": "./tests/v/test_eggs.py::TestSimple::test_simple",1417 "name": "test_simple",1418 "source": fix_path("./tests/v/spam.py:8"),1419 "markers": [],1420 "parentid": "./tests/v/test_eggs.py::TestSimple",1421 },1422 ######1423 {1424 "id": "./tests/v/test_ham.py::test_simple",1425 "name": "test_simple",1426 "source": fix_path("./tests/v/spam.py:2"),1427 "markers": [],1428 "parentid": "./tests/v/test_ham.py",1429 },1430 {1431 "id": "./tests/v/test_ham.py::test_not_hard",1432 "name": "test_not_hard",1433 "source": fix_path("./tests/v/spam.py:2"),1434 "markers": [],1435 "parentid": "./tests/v/test_ham.py",1436 },1437 ######1438 {1439 "id": "./tests/v/test_spam.py::test_simple",1440 "name": "test_simple",1441 "source": fix_path("./tests/v/spam.py:2"),1442 "markers": [],1443 "parentid": "./tests/v/test_spam.py",1444 },1445 {1446 "id": "./tests/v/test_spam.py::test_simpler",1447 "name": "test_simpler",1448 "source": fix_path("./tests/v/test_spam.py:4"),1449 "markers": [],1450 "parentid": "./tests/v/test_spam.py",1451 },1452 ###########1453 {1454 "id": "./tests/w/test_spam.py::test_simple",1455 "name": "test_simple",1456 "source": fix_path("./tests/w/test_spam.py:4"),1457 "markers": [],1458 "parentid": "./tests/w/test_spam.py",1459 },1460 {1461 "id": "./tests/w/test_spam_ex.py::test_simple",1462 "name": "test_simple",1463 "source": fix_path("./tests/w/test_spam_ex.py:4"),1464 "markers": [],1465 "parentid": "./tests/w/test_spam_ex.py",1466 },1467 ###########1468 {1469 "id": "./tests/x/y/z/test_ham.py::test_simple",1470 "name": "test_simple",1471 "source": fix_path("./tests/x/y/z/test_ham.py:2"),1472 "markers": [],1473 "parentid": "./tests/x/y/z/test_ham.py",1474 },1475 ######1476 {1477 "id": "./tests/x/y/z/a/test_spam.py::test_simple",1478 "name": "test_simple",1479 "source": fix_path("./tests/x/y/z/a/test_spam.py:11"),1480 "markers": [],1481 "parentid": "./tests/x/y/z/a/test_spam.py",1482 },1483 {1484 "id": "./tests/x/y/z/b/test_spam.py::test_simple",1485 "name": "test_simple",1486 "source": fix_path("./tests/x/y/z/b/test_spam.py:7"),1487 "markers": [],1488 "parentid": "./tests/x/y/z/b/test_spam.py",1489 },1490 ],...
test_unittest.py
Source:test_unittest.py
1"""Test script for unittest.2This just includes tests for new features. We really need a3full set of tests.4"""5import unittest6def test_TestSuite_iter():7 """8 >>> test1 = unittest.FunctionTestCase(lambda: None)9 >>> test2 = unittest.FunctionTestCase(lambda: None)10 >>> suite = unittest.TestSuite((test1, test2))11 >>> tests = []12 >>> for test in suite:13 ... tests.append(test)14 >>> tests == [test1, test2]15 True16 """17######################################################################18## Main19######################################################################20def test_main():21 from test import test_support, test_unittest22 test_support.run_doctest(test_unittest, verbosity=True)23if __name__ == '__main__':...
__init__.py
Source:__init__.py
1# __init__.py2# import test.test_unittest3# import test4# from .test_unittest import BasicUnittestTesting5# from . test_unittest import BasicUnittestTesting6# from . import test_unittest7# from . import test_unittest.BasicUnittestTesting...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!