Skip to content
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

Hypothesis' error reporting is broken in IPython (on Windows) #2319

Closed
rsokl opened this issue Jan 11, 2020 · 0 comments · Fixed by #2315
Closed

Hypothesis' error reporting is broken in IPython (on Windows) #2319

rsokl opened this issue Jan 11, 2020 · 0 comments · Fixed by #2315
Labels
bug

Comments

@rsokl
Copy link
Contributor

@rsokl rsokl commented Jan 11, 2020

Introduced in #2313

Context: running a failing test in IPython on Windows, using Hypothesis 5.1.4

WinError123 is raised from pathlib when running a failing Hypothesis test in the IPython console or a notebook:

@given(x=st.booleans())
def test(x):
    assert False
>>> test()

You can add @seed(210798464927815903715427164820480292552) to this test to reproduce this failure.
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
~\Anaconda3\envs\testing2\lib\site-packages\hypothesis\core.py in _execute_once_for_engine(self, data)
    646         try:
--> 647             result = self.execute_once(data)
    648             if result is not None:

~\Anaconda3\envs\testing2\lib\site-packages\hypothesis\core.py in execute_once(self, data, print_example, is_final, expected_failure)
    601         # In most cases this will delegate straight to `run(data)`.
--> 602         result = self.test_runner(data, run)
    603 

~\Anaconda3\envs\testing2\lib\site-packages\hypothesis\executors.py in default_new_style_executor(data, function)
     51 def default_new_style_executor(data, function):
---> 52     return function(data)
     53 

~\Anaconda3\envs\testing2\lib\site-packages\hypothesis\core.py in run(data)
    597                             report(output.getvalue())
--> 598                         return test(*args, **kwargs)
    599 

<ipython-input-18-f7c304bea5eb> in test_range_length(x)
      3 @given(x=st.booleans())
----> 4 def test_range_length(x):
      5     assert False

~\Anaconda3\envs\testing2\lib\site-packages\hypothesis\core.py in test(*args, **kwargs)
    521                 start = benchmark_time()
--> 522                 result = self.test(*args, **kwargs)
    523                 finish = benchmark_time()

<ipython-input-18-f7c304bea5eb> in test_range_length(x)
      4 def test_range_length(x):
----> 5     assert False
      6 

AssertionError: 

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
<ipython-input-18-f7c304bea5eb> in <module>
      5     assert False
      6 
----> 7 test_range_length()
      8 # </COGINST>

<ipython-input-18-f7c304bea5eb> in test_range_length()
      2 # <COGINST>
      3 @given(x=st.booleans())
----> 4 def test_range_length(x):
      5     assert False
      6 

~\Anaconda3\envs\testing2\lib\site-packages\hypothesis\core.py in wrapped_test(*arguments, **kwargs)
   1078                         get_trimmed_traceback()
   1079                     )
-> 1080                     raise the_error_hypothesis_found
   1081 
   1082         # After having created the decorated test function, we need to copy

~\Anaconda3\envs\testing2\lib\pathlib.py in resolve(self, strict)
   1159         if self._closed:
   1160             self._raise_closed()
-> 1161         s = self._flavour.resolve(self, strict=strict)
   1162         if s is None:
   1163             # No symlink resolution => for consistency, raise an error if

~\Anaconda3\envs\testing2\lib\pathlib.py in resolve(self, path, strict)
    203                 while True:
    204                     try:
--> 205                         s = self._ext_to_normal(_getfinalpathname(s))
    206                     except FileNotFoundError:
    207                         previous_s = s

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<ipython-input-18-f7c304bea5eb>'
@rsokl rsokl added the bug label Jan 11, 2020
@rsokl rsokl changed the title Hypothesis' error reporting is broken in IPython on Windows Hypothesis' error reporting is broken in IPython (on Windows) Jan 11, 2020
@Zac-HD Zac-HD closed this in #2315 Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.