Skip to content
Myr

Minor test fixes (#583)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Minor test fixes * Fix multipart test to less ambiguous file extension -> mime type check * Include a no-file-extension case in multipart tests

authored by Tom Christie · committed by GitHub · parent 33cb397 · Browse files · 2 files+6 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−2 removed

  • tests:+6 added−2 removed

2 files+6 added−2 removed

modified:tests/test_config.py+1 added-1 removed
220 unmodified lines
221 not hasattr(ssl.SSLContext, "keylog_filename"),222 reason="requires OpenSSL 1.1.1 or higher",223)224@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")225def test_ssl_config_support_for_keylog_file(tmpdir, monkeypatch):225def test_ssl_config_support_for_keylog_file(tmpdir, monkeypatch): # pragma: nocover226 with monkeypatch.context() as m:227 m.delenv("SSLKEYLOGFILE", raising=False)228229 ssl_config = httpx.SSLConfig(trust_env=True)
18 unmodified lines
modified:tests/test_multipart.py+5 added-1 removed
147 unmodified lines
148149150@pytest.mark.parametrize(151 "file_name,expected_content_type",152 [("example.json", "application/json"), ("example.log", "application/octet-stream")],152 [153 ("example.json", "application/json"),154 ("example.txt", "text/plain"),155 ("no-extension", "application/octet-stream"),156 ],157)158def test_multipart_encode_files_guesses_correct_content_type(159 file_name, expected_content_type160):
48 unmodified lines