flask-expects-json icon indicating copy to clipboard operation
flask-expects-json copied to clipboard

Test failures

Open fabaff opened this issue 2 years ago • 0 comments

On Python 3.10 and Python 3.11 I'm unable to get the tests to pass in a clean environment.

$ python setup.py test
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
[...]
test_validation_invalid (test_schema.TestExpects.test_validation_invalid) ... FAIL
test_validation_valid (test_schema.TestExpects.test_validation_valid) ... ok

======================================================================
FAIL: test_default_gets_validated (test_defaults.TestDefaults.test_default_gets_validated)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_defaults.py", line 81, in test_default_gets_validated
    self.assertIn('5 is not of type 'string'', response.data.decode())
AssertionError: '5 is not of type &#x27;string&#x27;' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>5 is not of type &#39;string&#39;<br><br>Failed validating &#39;type&#39; in schema[&#39;properties&#39;][&#39;name&#39;]:<br>    {&#39;default&#39;: 5, &#39;type&#39;: &#39;string&#39;}<br><br>On instance[&#39;name&#39;]:<br>    5</p>\n'

======================================================================
FAIL: test_format_validation_rejection (test_format_validation.TestDefaults.test_format_validation_rejection)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_format_validation.py", line 49, in test_format_validation_rejection
    self.assertIn('&#x27;-12&#x27; is not a &#x27;ipv4&#x27;', response.data.decode())
AssertionError: '&#x27;-12&#x27; is not a &#x27;ipv4&#x27;' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>&#39;-12&#39; is not a &#39;ipv4&#39;<br><br>Failed validating &#39;format&#39; in schema[&#39;properties&#39;][&#39;ipAddr&#39;]:<br>    {&#39;format&#39;: &#39;ipv4&#39;}<br><br>On instance[&#39;ipAddr&#39;]:<br>    &#39;-12&#39;</p>\n'

======================================================================
FAIL: test_default_behaviour (test_ignore.TestExpects.test_default_behaviour)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_ignore.py", line 33, in test_default_behaviour
    self.assertIn('Failed to decode', response.data.decode())
AssertionError: 'Failed to decode' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n'

======================================================================
FAIL: test_ignore_multiple (test_ignore.TestExpects.test_ignore_multiple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_ignore.py", line 57, in test_ignore_multiple
    self.assertIn('Failed to decode', response.data.decode())
AssertionError: 'Failed to decode' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n'

======================================================================
FAIL: test_ignore_one (test_ignore.TestExpects.test_ignore_one)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_ignore.py", line 46, in test_ignore_one
    self.assertIn('Failed to decode', response.data.decode())
AssertionError: 'Failed to decode' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n'

======================================================================
FAIL: test_check_mimetype (test_requests.TestExpects.test_check_mimetype)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_requests.py", line 55, in test_check_mimetype
    self.assertIn('Failed to decode', response.data.decode())
AssertionError: 'Failed to decode' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n'

======================================================================
FAIL: test_valid_decorator (test_requests.TestExpects.test_valid_decorator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_requests.py", line 40, in test_valid_decorator
    self.assertIn('Failed to decode', response.data.decode())
AssertionError: 'Failed to decode' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n'

======================================================================
FAIL: test_valid_decorator_no_schema_async (test_requests.TestExpects.test_valid_decorator_no_schema_async)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_requests.py", line 47, in test_valid_decorator_no_schema_async
    self.assertIn('Failed to decode', response.data.decode())
AssertionError: 'Failed to decode' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n'

======================================================================
FAIL: test_validation_invalid (test_schema.TestExpects.test_validation_invalid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/flask-expects-json/tests/test_schema.py", line 48, in test_validation_invalid
    self.assertIn('is not of type &#x27;number&#x27;', response.data.decode())
AssertionError: 'is not of type &#x27;number&#x27;' not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>&#39;invalid&#39; is not of type &#39;number&#39;<br><br>Failed validating &#39;type&#39; in schema[&#39;properties&#39;][&#39;price&#39;]:<br>    {&#39;type&#39;: &#39;number&#39;}<br><br>On instance[&#39;price&#39;]:<br>    &#39;invalid&#39;</p>\n'

----------------------------------------------------------------------
Ran 19 tests in 0.094s

FAILED (failures=9)
Test failed: <unittest.runner.TextTestResult run=19 errors=0 failures=9>
error: Test failed: <unittest.runner.TextTestResult run=19 errors=0 failures=9>

fabaff avatar Feb 24 '23 13:02 fabaff