annotate pytest.ini @ 8751:ad239692ea95

mail: fix duplicate "From" headers Problem introduced in 9a0c41175e66: When iterating the headers dict and setting "msg[key] = value", it wasn't replacing the header but performing add_header so we sometimes ended up with two From headers. It is also a general problem that while the headers dict only can contain each key once, it can contain entries that only differ in casing and thus will fold to the same message header, making it possible to end up adding duplicate headers. "msg.replace_header(key, value)" is not a simple solution to the problem: it will raise KeyError if no such previous key exists. Now, make the problem more clear by explicitly using add_header. Avoid the duplication problem by deleting the key (no matter which casing) before invoking add_header. Delete promises that "No exception is raised if the named field isn’t present in the headers".
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 04 Nov 2020 00:35:21 +0100
parents afa5e0bdb76f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5700
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
1 [pytest]
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
2 # only look for tests in kallithea/tests
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
3 python_files = kallithea/tests/**/test_*.py
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
4 addopts =
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
5 # --verbose
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
6 # show extra test summary info as specified by chars (f)ailed, (E)error, (s)skipped, (x)failed, (X)passed, (w)warnings.
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
7 -rfEsxXw
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
8 # Shorter scrollbacks; less stuff to scroll through
d88077fae3d6 pytest migration: switch to pytest; remove nose support
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
parents:
diff changeset
9 --tb=short
7734
afa5e0bdb76f tests: run doctests via pytest
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents: 5700
diff changeset
10 #
afa5e0bdb76f tests: run doctests via pytest
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents: 5700
diff changeset
11 --doctest-modules
afa5e0bdb76f tests: run doctests via pytest
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents: 5700
diff changeset
12 --doctest-ignore-import-errors