Lines Matching refs:testdir

53     def test_funcarg_lookupfails(self, testdir):  argument
54 testdir.copy_example()
55 result = testdir.runpytest() # "--collect-only")
65 def test_detect_recursive_dependency_error(self, testdir): argument
66 testdir.copy_example()
67 result = testdir.runpytest()
72 def test_funcarg_basic(self, testdir): argument
73 testdir.copy_example()
74 item = testdir.getitem(Path("test_funcarg_basic.py"))
81 def test_funcarg_lookup_modulelevel(self, testdir): argument
82 testdir.copy_example()
83 reprec = testdir.inline_run()
86 def test_funcarg_lookup_classlevel(self, testdir): argument
87 p = testdir.copy_example()
88 result = testdir.runpytest(p)
91 def test_conftest_funcargs_only_available_in_subdir(self, testdir): argument
92 testdir.copy_example()
93 result = testdir.runpytest("-v")
96 def test_extend_fixture_module_class(self, testdir): argument
97 testfile = testdir.copy_example()
98 result = testdir.runpytest()
100 result = testdir.runpytest(testfile)
103 def test_extend_fixture_conftest_module(self, testdir): argument
104 p = testdir.copy_example()
105 result = testdir.runpytest()
107 result = testdir.runpytest(next(p.visit("test_*.py")))
110 def test_extend_fixture_conftest_conftest(self, testdir): argument
111 p = testdir.copy_example()
112 result = testdir.runpytest()
114 result = testdir.runpytest(next(p.visit("test_*.py")))
117 def test_extend_fixture_conftest_plugin(self, testdir): argument
118 testdir.makepyfile(
127 testdir.syspathinsert()
128 testdir.makeconftest(
139 testdir.makepyfile(
145 result = testdir.runpytest("-s")
148 def test_extend_fixture_plugin_plugin(self, testdir): argument
150 testdir.makepyfile(
159 testdir.makepyfile(
168 testdir.syspathinsert()
169 testdir.makepyfile(
177 result = testdir.runpytest()
180 def test_override_parametrized_fixture_conftest_module(self, testdir): argument
182 testdir.makeconftest(
191 testfile = testdir.makepyfile(
203 result = testdir.runpytest()
205 result = testdir.runpytest(testfile)
208 def test_override_parametrized_fixture_conftest_conftest(self, testdir): argument
210 testdir.makeconftest(
219 subdir = testdir.mkpydir("subdir")
240 result = testdir.runpytest()
242 result = testdir.runpytest(testfile)
245 def test_override_non_parametrized_fixture_conftest_module(self, testdir): argument
247 testdir.makeconftest(
256 testfile = testdir.makepyfile(
271 result = testdir.runpytest()
273 result = testdir.runpytest(testfile)
276 def test_override_non_parametrized_fixture_conftest_conftest(self, testdir): argument
278 testdir.makeconftest(
287 subdir = testdir.mkpydir("subdir")
311 result = testdir.runpytest()
313 result = testdir.runpytest(testfile)
317 self, testdir argument
322 testdir.makeconftest(
331 subdir = testdir.mkpydir("subdir")
355 result = testdir.runpytest()
357 result = testdir.runpytest(testfile)
360 def test_autouse_fixture_plugin(self, testdir): argument
363 testdir.makepyfile(
372 testdir.syspathinsert()
373 testdir.makepyfile(
381 result = testdir.runpytest()
384 def test_funcarg_lookup_error(self, testdir): argument
385 testdir.makeconftest(
402 testdir.makepyfile(
408 result = testdir.runpytest()
421 def test_fixture_excinfo_leak(self, testdir): argument
423 testdir.makepyfile(
442 result = testdir.runpytest()
447 def test_request_attributes(self, testdir): argument
448 item = testdir.getitem(
466 def test_request_attributes_method(self, testdir): argument
467 (item,) = testdir.getitems(
483 def test_request_contains_funcarg_arg2fixturedefs(self, testdir): argument
484 modcol = testdir.getmodulecol(
495 (item1,) = testdir.genitems([modcol])
505 def test_request_garbage(self, testdir): argument
512 testdir.makepyfile(
538 result = testdir.runpytest_subprocess()
541 def test_getfixturevalue_recursive(self, testdir): argument
542 testdir.makeconftest(
551 testdir.makepyfile(
562 reprec = testdir.inline_run()
565 def test_getfixturevalue_teardown(self, testdir): argument
576 testdir.makepyfile(
600 result = testdir.runpytest()
604 def test_getfixturevalue(self, testdir, getfixmethod): argument
605 item = testdir.getitem(
647 def test_request_addfinalizer(self, testdir): argument
648 item = testdir.getitem(
668 def test_request_addfinalizer_failing_setup(self, testdir): argument
669 testdir.makepyfile(
683 reprec = testdir.inline_run("-s")
686 def test_request_addfinalizer_failing_setup_module(self, testdir): argument
687 testdir.makepyfile(
700 reprec = testdir.inline_run("-s")
704 def test_request_addfinalizer_partial_setup_failure(self, testdir): argument
705 p = testdir.makepyfile(
718 result = testdir.runpytest(p)
723 def test_request_subrequest_addfinalizer_exceptions(self, testdir): argument
728 testdir.makepyfile(
752 result = testdir.runpytest()
757 def test_request_getmodulepath(self, testdir): argument
758 modcol = testdir.getmodulecol("def test_somefunc(): pass")
759 (item,) = testdir.genitems([modcol])
763 def test_request_fixturenames(self, testdir): argument
764 testdir.makepyfile(
783 reprec = testdir.inline_run()
786 def test_request_fixturenames_dynamic_fixture(self, testdir): argument
788 testdir.copy_example("fixtures/test_getfixturevalue_dynamic.py")
789 result = testdir.runpytest()
792 def test_funcargnames_compatattr(self, testdir): argument
793 testdir.makepyfile(
808 reprec = testdir.inline_run()
811 def test_setupdecorator_and_xunit(self, testdir): argument
812 testdir.makepyfile(
840 reprec = testdir.inline_run("-v")
843 def test_fixtures_sub_subdir_normalize_sep(self, testdir): argument
845 b = testdir.mkdir("tests").mkdir("unit")
858 result = testdir.runpytest(p, "--fixtures")
867 def test_show_fixtures_color_yes(self, testdir): argument
868 testdir.makepyfile("def test_this(): assert 1")
869 result = testdir.runpytest("--color=yes", "--fixtures")
872 def test_newstyle_with_request(self, testdir): argument
873 testdir.makepyfile(
883 reprec = testdir.inline_run()
886 def test_setupcontext_no_param(self, testdir): argument
887 testdir.makepyfile(
901 reprec = testdir.inline_run()
906 def test_applymarker(self, testdir): argument
907 item1, item2 = testdir.getitems(
931 def test_accesskeywords(self, testdir): argument
932 testdir.makepyfile(
944 reprec = testdir.inline_run()
947 def test_accessmarker_dynamic(self, testdir): argument
948 testdir.makeconftest(
960 testdir.makepyfile(
971 reprec = testdir.inline_run()
976 def test_noargfixturedec(self, testdir): argument
977 testdir.makepyfile(
988 reprec = testdir.inline_run()
991 def test_receives_funcargs(self, testdir): argument
992 testdir.makepyfile(
1010 reprec = testdir.inline_run()
1013 def test_receives_funcargs_scope_mismatch(self, testdir): argument
1014 testdir.makepyfile(
1029 result = testdir.runpytest()
1039 def test_receives_funcargs_scope_mismatch_issue660(self, testdir): argument
1040 testdir.makepyfile(
1055 result = testdir.runpytest()
1060 def test_invalid_scope(self, testdir): argument
1061 testdir.makepyfile(
1072 result = testdir.runpytest_inprocess()
1077 def test_funcarg_parametrized_and_used_twice(self, testdir): argument
1078 testdir.makepyfile(
1096 result = testdir.runpytest()
1099 def test_factory_uses_unknown_funcarg_as_dependency_error(self, testdir): argument
1100 testdir.makepyfile(
1116 result = testdir.runpytest()
1127 def test_factory_setup_as_classes_fails(self, testdir): argument
1128 testdir.makepyfile(
1138 reprec = testdir.inline_run()
1143 def test_request_can_be_overridden(self, testdir): argument
1144 testdir.makepyfile(
1155 reprec = testdir.inline_run()
1158 def test_usefixtures_marker(self, testdir): argument
1159 testdir.makepyfile(
1180 reprec = testdir.inline_run()
1183 def test_usefixtures_ini(self, testdir): argument
1184 testdir.makeini(
1190 testdir.makeconftest(
1200 testdir.makepyfile(
1209 reprec = testdir.inline_run()
1212 def test_usefixtures_seen_in_showmarkers(self, testdir): argument
1213 result = testdir.runpytest("--markers")
1220 def test_request_instance_issue203(self, testdir): argument
1221 testdir.makepyfile(
1234 reprec = testdir.inline_run()
1237 def test_fixture_parametrized_with_iterator(self, testdir): argument
1238 testdir.makepyfile(
1261 reprec = testdir.inline_run("-v")
1266 def test_setup_functions_as_fixtures(self, testdir): argument
1268 testdir.makepyfile(
1302 result = testdir.runpytest()
1308 def testdir(self, request): member in TestFixtureManagerParseFactories
1309 testdir = request.getfixturevalue("testdir")
1310 testdir.makeconftest(
1327 return testdir
1329 def test_parsefactories_evil_objects_issue214(self, testdir): argument
1330 testdir.makepyfile(
1342 reprec = testdir.inline_run()
1345 def test_parsefactories_conftest(self, testdir): argument
1346 testdir.makepyfile(
1356 reprec = testdir.inline_run("-s")
1359 def test_parsefactories_conftest_and_module_and_class(self, testdir): argument
1360 testdir.makepyfile(
1382 reprec = testdir.inline_run("-s")
1385 def test_parsefactories_relative_node_ids(self, testdir): argument
1388 runner = testdir.mkdir("runner")
1389 package = testdir.mkdir("package")
1428 reprec = testdir.inline_run()
1431 reprec = testdir.inline_run("..")
1434 def test_package_xunit_fixture(self, testdir): argument
1435 testdir.makepyfile(
1440 package = testdir.mkdir("package")
1461 package = testdir.mkdir("package2")
1482 reprec = testdir.inline_run()
1485 def test_package_fixture_complex(self, testdir): argument
1486 testdir.makepyfile(
1491 testdir.syspathinsert(testdir.tmpdir.dirname)
1492 package = testdir.mkdir("package")
1523 reprec = testdir.inline_run()
1526 def test_collect_custom_items(self, testdir): argument
1527 testdir.copy_example("fixtures/custom_item")
1528 result = testdir.runpytest("foo")
1534 def testdir(self, testdir): member in TestAutouseDiscovery
1535 testdir.makeconftest(
1558 return testdir
1560 def test_parsefactories_conftest(self, testdir): argument
1561 testdir.makepyfile(
1571 reprec = testdir.inline_run("-s")
1574 def test_two_classes_separated_autouse(self, testdir): argument
1575 testdir.makepyfile(
1594 reprec = testdir.inline_run()
1597 def test_setup_at_classlevel(self, testdir): argument
1598 testdir.makepyfile(
1611 reprec = testdir.inline_run("-s")
1615 def test_setup_enabled_functionnode(self, testdir): argument
1616 testdir.makepyfile(
1639 reprec = testdir.inline_run("-s")
1642 def test_callables_nocode(self, testdir): argument
1647 testdir.makepyfile(
1658 reprec = testdir.inline_run("-s")
1661 def test_autouse_in_conftests(self, testdir): argument
1662 a = testdir.mkdir("a")
1663 b = testdir.mkdir("a1")
1664 conftest = testdir.makeconftest(
1675 result = testdir.runpytest()
1682 def test_autouse_in_module_and_two_classes(self, testdir): argument
1683 testdir.makepyfile(
1704 reprec = testdir.inline_run()
1709 def test_autouse_conftest_mid_directory(self, testdir): argument
1710 pkgdir = testdir.mkpydir("xyz123")
1732 reprec = testdir.inline_run("-s")
1735 def test_funcarg_and_setup(self, testdir): argument
1736 testdir.makepyfile(
1759 reprec = testdir.inline_run()
1762 def test_uses_parametrized_resource(self, testdir): argument
1763 testdir.makepyfile(
1785 reprec = testdir.inline_run("-s")
1788 def test_session_parametrized_function(self, testdir): argument
1789 testdir.makepyfile(
1812 reprec = testdir.inline_run("-v", "-s")
1815 def test_class_function_parametrization_finalization(self, testdir): argument
1816 p = testdir.makeconftest(
1838 testdir.makepyfile(
1850 confcut = "--confcutdir={}".format(testdir.tmpdir)
1851 reprec = testdir.inline_run("-v", "-s", confcut)
1857 def test_scope_ordering(self, testdir): argument
1858 testdir.makepyfile(
1877 reprec = testdir.inline_run()
1880 def test_parametrization_setup_teardown_ordering(self, testdir): argument
1881 testdir.makepyfile(
1906 reprec = testdir.inline_run("-s")
1909 def test_ordering_autouse_before_explicit(self, testdir): argument
1910 testdir.makepyfile(
1925 reprec = testdir.inline_run()
1930 def test_ordering_dependencies_torndown_first(self, testdir, param1, param2): argument
1932 testdir.makepyfile(
1952 reprec = testdir.inline_run("-s")
1957 def test_parametrize(self, testdir): argument
1958 testdir.makepyfile(
1971 reprec = testdir.inline_run()
1974 def test_multiple_parametrization_issue_736(self, testdir): argument
1975 testdir.makepyfile(
1989 reprec = testdir.inline_run()
1996 def test_override_parametrized_fixture_issue_979(self, testdir, param_args): argument
2001 testdir.makepyfile(
2015 reprec = testdir.inline_run()
2018 def test_scope_session(self, testdir): argument
2019 testdir.makepyfile(
2039 reprec = testdir.inline_run()
2042 def test_scope_session_exc(self, testdir): argument
2043 testdir.makepyfile(
2060 reprec = testdir.inline_run()
2063 def test_scope_session_exc_two_fix(self, testdir): argument
2064 testdir.makepyfile(
2086 reprec = testdir.inline_run()
2089 def test_scope_exc(self, testdir): argument
2090 testdir.makepyfile(
2115 reprec = testdir.inline_run()
2118 def test_scope_module_uses_session(self, testdir): argument
2119 testdir.makepyfile(
2139 reprec = testdir.inline_run()
2142 def test_scope_module_and_finalizer(self, testdir): argument
2143 testdir.makeconftest(
2161 testdir.makepyfile(
2179 reprec = testdir.inline_run()
2182 def test_scope_mismatch_various(self, testdir): argument
2183 testdir.makeconftest(
2193 testdir.makepyfile(
2203 result = testdir.runpytest(SHOW_PYTEST_WARNINGS_ARG)
2209 def test_register_only_with_mark(self, testdir): argument
2210 testdir.makeconftest(
2218 testdir.makepyfile(
2228 reprec = testdir.inline_run()
2231 def test_parametrize_and_scope(self, testdir): argument
2232 testdir.makepyfile(
2243 reprec = testdir.inline_run("-v")
2251 def test_scope_mismatch(self, testdir): argument
2252 testdir.makeconftest(
2260 testdir.makepyfile(
2270 result = testdir.runpytest()
2273 def test_parametrize_separated_order(self, testdir): argument
2274 testdir.makepyfile(
2289 reprec = testdir.inline_run("-v")
2294 def test_module_parametrized_ordering(self, testdir): argument
2295 testdir.makeini(
2301 testdir.makeconftest(
2313 testdir.makepyfile(
2331 result = testdir.runpytest("-v")
2353 def test_dynamic_parametrized_ordering(self, testdir): argument
2354 testdir.makeini(
2360 testdir.makeconftest(
2380 testdir.makepyfile(
2388 result = testdir.runpytest("-v")
2402 def test_class_ordering(self, testdir): argument
2403 testdir.makeini(
2409 testdir.makeconftest(
2430 testdir.makepyfile(
2444 result = testdir.runpytest("-vs")
2462 def test_parametrize_separated_order_higher_scope_first(self, testdir): argument
2463 testdir.makepyfile(
2492 reprec = testdir.inline_run("-v")
2538 def test_parametrized_fixture_teardown_order(self, testdir): argument
2539 testdir.makepyfile(
2571 result = testdir.runpytest("-v")
2579 def test_fixture_finalizer(self, testdir): argument
2580 testdir.makeconftest(
2594 b = testdir.mkdir("subdir")
2609 reprec = testdir.runpytest("-s")
2613 def test_class_scope_with_normal_tests(self, testdir): argument
2614 testpath = testdir.makepyfile(
2637 reprec = testdir.inline_run(testpath)
2641 def test_request_is_clean(self, testdir): argument
2642 testdir.makepyfile(
2653 reprec = testdir.inline_run("-s")
2657 def test_parametrize_separated_lifecycle(self, testdir): argument
2658 testdir.makepyfile(
2674 reprec = testdir.inline_run("-vs")
2686 def test_parametrize_function_scoped_finalizers_called(self, testdir): argument
2687 testdir.makepyfile(
2707 reprec = testdir.inline_run("-v")
2711 def test_finalizer_order_on_parametrization(self, scope, testdir): argument
2713 testdir.makepyfile(
2744 reprec = testdir.inline_run("-lvs")
2747 def test_class_scope_parametrization_ordering(self, testdir): argument
2749 testdir.makepyfile(
2770 reprec = testdir.inline_run()
2786 def test_parametrize_setup_function(self, testdir): argument
2787 testdir.makepyfile(
2816 reprec = testdir.inline_run("-v")
2819 def test_fixture_marked_function_not_collected_as_test(self, testdir): argument
2820 testdir.makepyfile(
2831 reprec = testdir.inline_run()
2834 def test_params_and_ids(self, testdir): argument
2835 testdir.makepyfile(
2848 res = testdir.runpytest("-v")
2851 def test_params_and_ids_yieldfixture(self, testdir): argument
2852 testdir.makepyfile(
2865 res = testdir.runpytest("-v")
2868 def test_deterministic_fixture_collection(self, testdir, monkeypatch): argument
2870 testdir.makepyfile(
2895 out1 = testdir.runpytest_subprocess("-v")
2897 out2 = testdir.runpytest_subprocess("-v")
2923 def test_setup(self, testdir, scope, ok, error): argument
2924 testdir.makepyfile(
2941 reprec = testdir.inline_run("-l")
2944 def test_funcarg(self, testdir, scope, ok, error): argument
2945 testdir.makepyfile(
2962 reprec = testdir.inline_run()
2967 def test_subfactory_missing_funcarg(self, testdir): argument
2968 testdir.makepyfile(
2978 result = testdir.runpytest()
2984 def test_issue498_fixture_finalizer_failing(self, testdir): argument
2985 testdir.makepyfile(
3004 result = testdir.runpytest()
3015 def test_setupfunc_missing_funcarg(self, testdir): argument
3016 testdir.makepyfile(
3026 result = testdir.runpytest()
3034 def test_funcarg_compat(self, testdir): argument
3035 config = testdir.parseconfigure("--funcargs")
3038 def test_show_fixtures(self, testdir): argument
3039 result = testdir.runpytest("--fixtures")
3049 def test_show_fixtures_verbose(self, testdir): argument
3050 result = testdir.runpytest("--fixtures", "-v")
3060 def test_show_fixtures_testmodule(self, testdir): argument
3061 p = testdir.makepyfile(
3072 result = testdir.runpytest("--fixtures", p)
3084 def test_show_fixtures_conftest(self, testdir, testmod): argument
3085 testdir.makeconftest(
3094 testdir.makepyfile(
3100 result = testdir.runpytest("--fixtures")
3110 def test_show_fixtures_trimmed_doc(self, testdir): argument
3111 p = testdir.makepyfile(
3132 result = testdir.runpytest("--fixtures", p)
3147 def test_show_fixtures_indented_doc(self, testdir): argument
3148 p = testdir.makepyfile(
3161 result = testdir.runpytest("--fixtures", p)
3173 def test_show_fixtures_indented_doc_first_line_unindented(self, testdir): argument
3174 p = testdir.makepyfile(
3187 result = testdir.runpytest("--fixtures", p)
3200 def test_show_fixtures_indented_in_class(self, testdir): argument
3201 p = testdir.makepyfile(
3215 result = testdir.runpytest("--fixtures", p)
3228 def test_show_fixtures_different_files(self, testdir): argument
3232 testdir.makepyfile(
3245 testdir.makepyfile(
3258 result = testdir.runpytest("--fixtures")
3271 def test_show_fixtures_with_same_name(self, testdir): argument
3272 testdir.makeconftest(
3281 testdir.makepyfile(
3287 testdir.makepyfile(
3298 result = testdir.runpytest("--fixtures")
3323 def flavor(self, request, testdir, monkeypatch): argument
3325 testdir.makepyfile(
3339 def test_simple(self, testdir, flavor): argument
3340 testdir.makepyfile(
3356 result = testdir.runpytest("-s")
3368 def test_scoped(self, testdir, flavor): argument
3369 testdir.makepyfile(
3384 result = testdir.runpytest("-s")
3394 def test_setup_exception(self, testdir, flavor): argument
3395 testdir.makepyfile(
3406 result = testdir.runpytest("-s")
3414 def test_teardown_exception(self, testdir, flavor): argument
3415 testdir.makepyfile(
3426 result = testdir.runpytest("-s")
3434 def test_yields_more_than_one(self, testdir, flavor): argument
3435 testdir.makepyfile(
3446 result = testdir.runpytest("-s")
3454 def test_custom_name(self, testdir, flavor): argument
3455 testdir.makepyfile(
3465 result = testdir.runpytest("-s")
3470 def test_call_from_fixture(self, testdir): argument
3471 testdir.makepyfile(
3487 result = testdir.runpytest()
3500 def test_call_from_test(self, testdir): argument
3501 testdir.makepyfile(
3513 result = testdir.runpytest()
3526 def test_external_fixture(self, testdir): argument
3527 testdir.makeconftest(
3537 testdir.makepyfile(
3543 result = testdir.runpytest()
3557 def test_non_relative_path(self, testdir): argument
3558 tests_dir = testdir.mkdir("tests")
3559 fixdir = testdir.mkdir("fixtures")
3586 testdir.syspathinsert(fixdir)
3587 result = testdir.runpytest()
3602 def test_pytest_fixture_setup_and_post_finalizer_hook(testdir): argument
3603 testdir.makeconftest(
3612 testdir.makepyfile(
3635 result = testdir.runpytest("-s")
3652 def test_func_closure_module_auto(self, testdir, variant, monkeypatch): argument
3655 testdir.makepyfile(
3681 items, _ = testdir.inline_genitems()
3685 def test_func_closure_with_native_fixtures(self, testdir, monkeypatch): argument
3690 testdir.makepyfile(
3727 items, _ = testdir.inline_genitems()
3733 testdir.runpytest()
3739 def test_func_closure_module(self, testdir): argument
3740 testdir.makepyfile(
3754 items, _ = testdir.inline_genitems()
3758 def test_func_closure_scopes_reordered(self, testdir): argument
3762 testdir.makepyfile(
3787 items, _ = testdir.inline_genitems()
3791 def test_func_closure_same_scope_closer_root_first(self, testdir): argument
3793 testdir.makeconftest(
3801 testdir.makepyfile(
3827 items, _ = testdir.inline_genitems()
3831 def test_func_closure_all_scopes_complex(self, testdir): argument
3833 testdir.makeconftest(
3844 testdir.makepyfile(**{"__init__.py": ""})
3845 testdir.makepyfile(
3871 items, _ = testdir.inline_genitems()
3875 def test_multiple_packages(self, testdir): argument
3890 root = testdir.mkdir("root")
3940 reprec = testdir.inline_run()
3955 def test_fixture_param_shadowing(testdir): argument
3957 testdir.makepyfile(
3990 result = testdir.runpytest("-v")