All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
2 MyLovelyCompanyTeamProjectComponent, # NOT DRY
4 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
5 MyLovelyCompanyTeamProjectComponent as component, # DRY
10 @pytest.mark.parametrize(
11 ("post_data", "message"),
13 # metadata_version errors.
16 "None is an invalid value for Metadata-Version. Error: This field is"
18 " https://packaging.python.org/specifications/core-metadata",
21 {"metadata_version": "-1"},
22 "'-1' is an invalid value for Metadata-Version. Error: Unknown Metadata"
24 " https://packaging.python.org/specifications/core-metadata",
28 {"metadata_version": "1.2"},
29 "'' is an invalid value for Name. Error: This field is required. see"
30 " https://packaging.python.org/specifications/core-metadata",
33 {"metadata_version": "1.2", "name": "foo-"},
34 "'foo-' is an invalid value for Name. Error: Must start and end with a"
35 " letter or numeral and contain only ascii numeric and '.', '_' and"
36 " '-'. see https://packaging.python.org/specifications/core-metadata",
40 {"metadata_version": "1.2", "name": "example"},
41 "'' is an invalid value for Version. Error: This field is required. see"
42 " https://packaging.python.org/specifications/core-metadata",
45 {"metadata_version": "1.2", "name": "example", "version": "dog"},
46 "'dog' is an invalid value for Version. Error: Must start and end with"
47 " a letter or numeral and contain only ascii numeric and '.', '_' and"
48 " '-'. see https://packaging.python.org/specifications/core-metadata",
52 def test_fails_invalid_post_data(
53 self, pyramid_config, db_request, post_data, message
55 pyramid_config.testing_securitypolicy(userid=1)
56 db_request.POST = MultiDict(post_data)
59 def foo(list_a, list_b):
61 User.query.filter(User.foo == "bar")
62 .filter( # Because foo.
63 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
65 .filter(User.xyz.is_(None))
66 # Another comment about the filtering on is_quux goes here.
67 .filter(db.not_(User.is_pending.astext.cast(db.Boolean).is_(True)))
68 .order_by(User.created_at.desc())
69 .with_for_update(key_share=True)
75 def foo2(list_a, list_b):
76 # Standalone comment reasonably placed.
78 User.query.filter(User.foo == "bar")
80 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
82 .filter(User.xyz.is_(None))
86 def foo3(list_a, list_b):
88 # Standlone comment but weirdly placed.
89 User.query.filter(User.foo == "bar")
91 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
93 .filter(User.xyz.is_(None))