-
-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.4.4: pytest is failing #317
Comments
Looks like below patch fixe all relative imports. --- a/colorama/tests/winterm_test.py~ 2020-10-13 05:46:33.000000000 +0100
+++ b/colorama/tests/winterm_test.py 2022-01-10 15:25:56.441529729 +0000
@@ -7,7 +7,7 @@
except ImportError:
from mock import Mock, patch
-from ..winterm import WinColor, WinStyle, WinTerm
+from colorama.winterm import WinColor, WinStyle, WinTerm
class WinTermTest(TestCase):
--- a/colorama/tests/isatty_test.py~ 2020-10-13 05:46:33.000000000 +0100
+++ b/colorama/tests/isatty_test.py 2022-01-10 15:26:08.247639829 +0000
@@ -2,8 +2,8 @@
import sys
from unittest import TestCase, main
-from ..ansitowin32 import StreamWrapper, AnsiToWin32
-from .utils import pycharm, replace_by, replace_original_by, StreamTTY, StreamNonTTY
+from colorama.ansitowin32 import StreamWrapper, AnsiToWin32
+from colorama.tests.utils import pycharm, replace_by, replace_original_by, StreamTTY, StreamNonTTY
def is_a_tty(stream):
--- a/colorama/tests/ansi_test.py~ 2020-10-13 05:46:33.000000000 +0100
+++ b/colorama/tests/ansi_test.py 2022-01-10 15:26:18.470735151 +0000
@@ -2,8 +2,8 @@
import sys
from unittest import TestCase, main
-from ..ansi import Back, Fore, Style
-from ..ansitowin32 import AnsiToWin32
+from colorama.ansi import Back, Fore, Style
+from colorama.ansitowin32 import AnsiToWin32
stdout_orig = sys.stdout
stderr_orig = sys.stderr
--- a/colorama/tests/ansitowin32_test.py~ 2020-10-13 05:46:33.000000000 +0100
+++ b/colorama/tests/ansitowin32_test.py 2022-01-10 15:26:35.343892509 +0000
@@ -7,8 +7,8 @@
except ImportError:
from mock import MagicMock, Mock, patch
-from ..ansitowin32 import AnsiToWin32, StreamWrapper
-from .utils import osname
+from colorama.ansitowin32 import AnsiToWin32, StreamWrapper
+from colorama.tests.utils import osname
class StreamWrapperTest(TestCase):
--- a/colorama/tests/initialise_test.py~ 2020-10-13 05:46:33.000000000 +0100
+++ b/colorama/tests/initialise_test.py 2022-01-10 15:26:48.016010677 +0000
@@ -8,9 +8,9 @@
except ImportError:
from mock import patch
-from ..ansitowin32 import StreamWrapper
-from ..initialise import init
-from .utils import osname, redirected_output, replace_by
+from colorama.ansitowin32 import StreamWrapper
+from colorama.initialise import init
+from colorama.tests.utils import osname, redirected_output, replace_by
orig_stdout = sys.stdout
orig_stderr = sys.stderr
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-colorama-0.4.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-colorama-0.4.4-5.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/colorama-0.4.4
collected 49 items
colorama/tests/ansi_test.py ... [ 6%]
colorama/tests/ansitowin32_test.py .................... [ 46%]
colorama/tests/initialise_test.py sssssssssss [ 69%]
colorama/tests/isatty_test.py ....... [ 83%]
colorama/tests/winterm_test.py sss....s [100%]
========================================================================= short test summary info ==========================================================================
SKIPPED [1] colorama/tests/initialise_test.py:117: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:99: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:90: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:69: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:61: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:49: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:56: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:82: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:74: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:79: sys.stdout is not a tty
SKIPPED [1] colorama/tests/initialise_test.py:42: sys.stdout is not a tty
SKIPPED [1] colorama/tests/winterm_test.py:77: requires Windows
SKIPPED [1] colorama/tests/winterm_test.py:66: requires Windows
SKIPPED [1] colorama/tests/winterm_test.py:25: requires Windows
SKIPPED [1] colorama/tests/winterm_test.py:88: requires Windows
====================================================================== 34 passed, 15 skipped in 0.22s ====================================================================== Please let me know if you want this as PR. |
You are absolutely right, this should definitely be done. Thanks for the report and the diffs, I'll try and implement it right now. |
updated patch for 0.4.6 --- a/colorama/tests/winterm_test.py
+++ b/colorama/tests/winterm_test.py
@@ -7,7 +7,7 @@
except ImportError:
from mock import Mock, patch
-from ..winterm import WinColor, WinStyle, WinTerm
+from colorama.winterm import WinColor, WinStyle, WinTerm
class WinTermTest(TestCase):
--- a/colorama/tests/isatty_test.py
+++ b/colorama/tests/isatty_test.py
@@ -2,8 +2,8 @@
import sys
from unittest import TestCase, main
-from ..ansitowin32 import StreamWrapper, AnsiToWin32
-from .utils import pycharm, replace_by, replace_original_by, StreamTTY, StreamNonTTY
+from colorama.ansitowin32 import StreamWrapper, AnsiToWin32
+from colorama.tests.utils import pycharm, replace_by, replace_original_by, StreamTTY, StreamNonTTY
def is_a_tty(stream):
--- a/colorama/tests/ansi_test.py
+++ b/colorama/tests/ansi_test.py
@@ -2,8 +2,8 @@
import sys
from unittest import TestCase, main
-from ..ansi import Back, Fore, Style
-from ..ansitowin32 import AnsiToWin32
+from colorama.ansi import Back, Fore, Style
+from colorama.ansitowin32 import AnsiToWin32
stdout_orig = sys.stdout
stderr_orig = sys.stderr
--- a/colorama/tests/ansitowin32_test.py
+++ b/colorama/tests/ansitowin32_test.py
@@ -12,9 +12,9 @@
except ImportError:
from mock import MagicMock, Mock, patch
-from ..ansitowin32 import AnsiToWin32, StreamWrapper
-from ..win32 import ENABLE_VIRTUAL_TERMINAL_PROCESSING
-from .utils import osname
+from colorama.ansitowin32 import AnsiToWin32, StreamWrapper
+from colorama.win32 import ENABLE_VIRTUAL_TERMINAL_PROCESSING
+from colorama.tests.utils import osname
class StreamWrapperTest(TestCase):
--- a/colorama/tests/initialise_test.py
+++ b/colorama/tests/initialise_test.py
@@ -7,9 +7,9 @@
except ImportError:
from mock import patch, Mock
-from ..ansitowin32 import StreamWrapper
-from ..initialise import init, just_fix_windows_console, _wipe_internal_state_for_tests
-from .utils import osname, replace_by
+from colorama.ansitowin32 import StreamWrapper
+from colorama.initialise import init, just_fix_windows_console, _wipe_internal_state_for_tests
+from colorama.tests.utils import osname, replace_by
orig_stdout = sys.stdout
orig_stderr = sys.stderr It is as well second issue as well. Files from colorama/tests are installed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.
Looks like it
colorama.tests
module is not installed and it is kind of assumption that tested will be source tree and not what actiually is installed (which is very untypical)The text was updated successfully, but these errors were encountered: