Open cdent opened 4 years ago
FWIW, I can't easily reproduce this in tests:
I created gabbi/tests/gabbits_live/device-types.yaml
fixtures:
- LiveSkipFixture
defaults:
ssl: True
tests:
- name: google
POST: /
status: 405
tox -epy37 -- test_live
is all green
in order to get rid of the Content-Type
response header, I adjusted the YAML file to point to a custom WSGI server:
#!/usr/bin/env python3
from time import sleep
def handler(environ, start_response):
start_response("200 OK", [("Server", "WSGI Dummy")])
return (txt.encode("utf-8") for txt in generate_chunks())
def generate_chunks():
yield "abc"
sleep(1)
yield "123"
if __name__ == "__main__":
from wsgiref.simple_server import make_server
host = "localhost"
port = 8080
srv = make_server(host, port, handler)
print("→ http://%s:%s" % (host, port))
srv.serve_forever()
GOTO 2; same result
AFAICT gabbits_live
is run through gabbi/tests/test_live.py
, which does appear to use unittest. 🤷♂
Bear with me, this is hard to explain
Python v 3.6.9
gabbi: 1.49.0
A test file with named
device-types.yaml
with a test of:errors with the following when run in a unittest-style harness:
However, rename the file to
foo.yaml
and the test works, or run thedevice-types.yaml
file withgabbi-run
and the tests work. Presumably something about test naming.So the short term workaround is to rename the file, but this needs to be fixed because using
-
in filenames is idiomatic for gabbi.