Skip to content

Commit

Permalink
test: mark some tests for pep669
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Dec 2, 2023
1 parent 24e5619 commit e31c159
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from coverage.misc import import_local_file
from coverage.types import FilePathClasses, FilePathType, TCovKwargs

from tests import testenv
from tests.coveragetest import CoverageTest, TESTS_DIR, UsingModulesMixin
from tests.helpers import assert_count_equal, assert_coverage_warnings
from tests.helpers import change_dir, nice_file, os_sep
Expand Down Expand Up @@ -625,6 +626,7 @@ def test_run_debug_sys(self) -> None:
assert cast(str, d['data_file']).endswith(".coverage")


@pytest.mark.skipif(not testenv.DYN_CONTEXTS, reason="No dynamic contexts with this core.")
class SwitchContextTest(CoverageTest):
"""Tests of the .switch_context() method."""

Expand Down
3 changes: 3 additions & 0 deletions tests/test_arcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import pytest

from tests import testenv
from tests.coveragetest import CoverageTest
from tests.helpers import assert_count_equal, xfail_pypy38

Expand Down Expand Up @@ -1307,6 +1308,7 @@ def gen(inp):
arcz=".1 19 9. .2 23 34 45 56 63 37 7.",
)

@pytest.mark.xfail(testenv.SYS_MON, reason="TODO: fix this for sys.monitoring")
def test_abandoned_yield(self) -> None:
# https://github.com/nedbat/coveragepy/issues/440
self.check_coverage("""\
Expand Down Expand Up @@ -1649,6 +1651,7 @@ def test_pathologically_long_code_object(self, n: int) -> None:
self.check_coverage(code, arcs=[(-1, 1), (1, 2*n+4), (2*n+4, -1)])
assert self.stdout() == f"{n}\n"

@pytest.mark.xfail(testenv.SYS_MON, reason="TODO: fix this for sys.monitoring")
def test_partial_generators(self) -> None:
# https://github.com/nedbat/coveragepy/issues/475
# Line 2 is executed completely.
Expand Down
3 changes: 3 additions & 0 deletions tests/test_concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ def try_multiprocessing_code(
last_line = self.squeezed_lines(out)[-1]
assert re.search(r"TOTAL \d+ 0 100%", last_line)

@pytest.mark.skipif(env.METACOV and testenv.SYS_MON, reason="buh")
def test_multiprocessing_simple(self, start_method: str) -> None:
nprocs = 3
upto = 30
Expand All @@ -514,6 +515,7 @@ def test_multiprocessing_simple(self, start_method: str) -> None:
start_method=start_method,
)

@pytest.mark.skipif(env.METACOV and testenv.SYS_MON, reason="buh")
def test_multiprocessing_append(self, start_method: str) -> None:
nprocs = 3
upto = 30
Expand Down Expand Up @@ -546,6 +548,7 @@ def test_multiprocessing_and_gevent(self, start_method: str) -> None:
start_method=start_method,
)

@pytest.mark.skipif(env.METACOV and testenv.SYS_MON, reason="buh")
def test_multiprocessing_with_branching(self, start_method: str) -> None:
nprocs = 3
upto = 30
Expand Down
2 changes: 2 additions & 0 deletions tests/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from coverage import env
from coverage.exceptions import NoDataError

from tests import testenv
from tests.coveragetest import CoverageTest


Expand Down Expand Up @@ -1813,6 +1814,7 @@ def test_formfeed(self) -> None:
[1, 6], "", excludes=['assert'],
)

@pytest.mark.xfail(testenv.SYS_MON, reason="TODO: fix this for sys.monitoring")
def test_excluded_comprehension_branches(self) -> None:
# https://github.com/nedbat/coveragepy/issues/1271
self.check_coverage("""\
Expand Down

0 comments on commit e31c159

Please sign in to comment.