From a1dc9a47db667e269ec97e6524f912555b3aab15 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Fri, 4 Oct 2024 10:21:39 +0200 Subject: [PATCH] no linting in tox --- test/unit/__init__.py | 6 ++++++ test/unit/pep8_tests.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/test/unit/__init__.py b/test/unit/__init__.py index 9cb55933..4d1b797f 100644 --- a/test/unit/__init__.py +++ b/test/unit/__init__.py @@ -83,6 +83,12 @@ def skip_if_rpmbuild(): skip("not supported for rpmbuild") +def skip_if_tox(): + """ some tests don't work nice with Tox """ + if "TOX_WORK_DIR" in os.environ: + skip("doesn't work in tox") + + class Capture(object): class Tee(object): def __init__(self, stream, silent): diff --git a/test/unit/pep8_tests.py b/test/unit/pep8_tests.py index a844c340..8c5466ee 100644 --- a/test/unit/pep8_tests.py +++ b/test/unit/pep8_tests.py @@ -35,6 +35,7 @@ from tito.compat import * # NOQA from tito.compat import StringIO, redirect_stdout from unit.fixture import TitoUnitTestFixture, REPO_DIR +from unit import skip_if_tox class TestPep8(TitoUnitTestFixture): @@ -94,6 +95,8 @@ def test_conformance(self): class UglyHackishTest(TitoUnitTestFixture): def setUp(self): + # These tests give false-positives for .tox/ directory + skip_if_tox() TitoUnitTestFixture.setUp(self) os.chdir(REPO_DIR)