pystmark icon indicating copy to clipboard operation
pystmark copied to clipboard

Tests Fail on Windows

Open speedplane opened this issue 6 years ago • 3 comments

Attempting to make a pull request here, and trying to run tests, but I'm running into difficulty getting them off the ground. I get the following exception:

> python ./setup.py test --with-integration
running test
Traceback (most recent call last):
  File "./setup.py", line 127, in <module>
    'Topic :: Communications :: Email',
  File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "C:\Python27\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "./setup.py", line 86, in run
    self._no_print_statements()
  File "./setup.py", line 43, in _no_print_statements
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "C:\Python27\lib\subprocess.py", line 351, in __init__
    raise ValueError("close_fds is not supported on Windows "
ValueError: close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr

That was problem 1, but then I made _no_print_statements a do-nothing function, and I still ran into a number of validation failures.


======================================================================
ERROR: test_get_bounce (tests.integration.test_pystmark.BounceLiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\integration\test_pystmark.py", line 35, in test_get_bounce
    r = pystmark.get_bounce(777, test=True)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\pystmark.py", line 185, in get_bounce
    test=test, **request_args)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\pystmark.py", line 1291, in get
    return self._request(url, headers=headers, **request_args)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\pystmark.py", line 921, in _request
    return self.response_class(response, sender=self)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\pystmark.py", line 809, in __init__
    self.bounce = BouncedMessage(self._data, sender=sender)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\pystmark.py", line 613, in __init__
    self.id = bounce_data['ID']
KeyError: 'ID'
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): api.postmarkapp.com:443
urllib3.connectionpool: DEBUG: https://api.postmarkapp.com:443 "GET /bounces/777 HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_bounce_activate (tests.integration.test_pystmark.BounceActivateLiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\integration\test_pystmark.py", line 57, in test_bounce_activate
    self.assert500(r)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\test_pystmark.py", line 81, in assert500
    self.assertEqual(r.status_code, 500)
AssertionError: 200 != 500
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): api.postmarkapp.com:443
urllib3.connectionpool: DEBUG: https://api.postmarkapp.com:443 "PUT /bounces/777/activate HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_get_bounce_dump (tests.integration.test_pystmark.BounceDumpLiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\integration\test_pystmark.py", line 43, in test_get_bounce_dump
    self.assert500(r)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\test_pystmark.py", line 81, in assert500
    self.assertEqual(r.status_code, 500)
AssertionError: 200 != 500
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): api.postmarkapp.com:443
urllib3.connectionpool: DEBUG: https://api.postmarkapp.com:443 "GET /bounces/777/dump HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_get_bounce_tags (tests.integration.test_pystmark.BounceTagsLiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\integration\test_pystmark.py", line 50, in test_get_bounce_tags
    self.assert500(r)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\test_pystmark.py", line 81, in assert500
    self.assertEqual(r.status_code, 500)
AssertionError: 200 != 500
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): api.postmarkapp.com:443
urllib3.connectionpool: DEBUG: https://api.postmarkapp.com:443 "GET /bounces/tags HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_get_bounces (tests.integration.test_pystmark.BouncesLiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\integration\test_pystmark.py", line 29, in test_get_bounces
    self.assert500(r)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\test_pystmark.py", line 81, in assert500
    self.assertEqual(r.status_code, 500)
AssertionError: 200 != 500
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): api.postmarkapp.com:443
urllib3.connectionpool: DEBUG: https://api.postmarkapp.com:443 "GET /bounces?count=25&offset=0 HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_get_delivery_stats (tests.integration.test_pystmark.DeliveryStatsLiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\integration\test_pystmark.py", line 64, in test_get_delivery_stats
    self.assert500(r)
  File "C:\Users\mes65\Documents\DAWork\github_libs\pystmark\tests\test_pystmark.py", line 81, in assert500
    self.assertEqual(r.status_code, 500)
AssertionError: 200 != 500
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): api.postmarkapp.com:443
urllib3.connectionpool: DEBUG: https://api.postmarkapp.com:443 "GET /deliverystats HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------

Name                Stmts   Miss  Cover
---------------------------------------
_pystmark_meta.py       3      0   100%
pystmark.py           514      0   100%
---------------------------------------
TOTAL                 517      0   100%
----------------------------------------------------------------------
Ran 93 tests in 2.456s

FAILED (errors=1, failures=5)

speedplane avatar Aug 16 '18 03:08 speedplane

Note that I only get the latter set of errors when I run ./setup.py test --no-integration. When I run ./setup.py test, it runs without an issue.

speedplane avatar Aug 16 '18 03:08 speedplane

C

ghost avatar Aug 18 '21 01:08 ghost

TDuplicate of #

ghost avatar Aug 18 '21 01:08 ghost