File: test_locals.py

package info (click to toggle)
pytest-check 2.7.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 480 kB
  • sloc: python: 2,220; sh: 17; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 639 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def test_locals_context_manager(pytester):
    pytester.copy_example("examples/test_example_locals.py")
    result = pytester.runpytest("test_example_locals.py::test_ctx", "-l")
    result.assert_outcomes(failed=1)
    result.stdout.fnmatch_lines([
        "*a *= 1*",
        "*b *= 2*"
    ])


def test_locals_check_function(pytester):
    pytester.copy_example("examples/test_example_locals.py")
    result = pytester.runpytest("test_example_locals.py::test_check_func",
                                "--showlocals")
    result.assert_outcomes(failed=1)
    result.stdout.fnmatch_lines([
        "*a *= 1*",
        "*b *= 2*"
    ])