pytest-postgresql 6.1.0__tar.gz → 7.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/AUTHORS.rst +1 -1
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/CHANGES.rst +107 -42
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/CONTRIBUTING.rst +16 -6
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/COPYING +1 -1
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/COPYING.lesser +1 -1
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/PKG-INFO +58 -52
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/README.rst +48 -42
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pyproject.toml +13 -14
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/__init__.py +1 -1
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/config.py +4 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/executor.py +2 -2
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/factories/client.py +8 -21
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/factories/noprocess.py +6 -2
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/factories/process.py +34 -5
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/janitor.py +2 -2
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/loader.py +1 -1
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/plugin.py +21 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/PKG-INFO +58 -52
- pytest_postgresql-7.0.0/pytest_postgresql.egg-info/requires.txt +5 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/tests/test_executor.py +2 -2
- pytest_postgresql-7.0.0/tests/test_postgres_options_plugin.py +123 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/tests/test_postgresql.py +3 -12
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/tests/test_template_database.py +1 -0
- pytest_postgresql-6.1.0/pytest_postgresql.egg-info/requires.txt +0 -5
- pytest_postgresql-6.1.0/tests/test_postgres_options_plugin.py +0 -43
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/MANIFEST.in +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/exceptions.py +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/executor_noop.py +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/factories/__init__.py +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/py.typed +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql/retry.py +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/SOURCES.txt +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/dependency_links.txt +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/entry_points.txt +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/top_level.txt +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/zip-safe +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/setup.cfg +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/tests/test_janitor.py +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/tests/test_loader.py +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/tests/test_noopexecutor.py +0 -0
- {pytest_postgresql-6.1.0 → pytest_postgresql-7.0.0}/tests/test_version.py +0 -0
|
@@ -3,19 +3,84 @@ CHANGELOG
|
|
|
3
3
|
|
|
4
4
|
.. towncrier release notes start
|
|
5
5
|
|
|
6
|
+
7.0.0 (2025-02-23)
|
|
7
|
+
==================
|
|
8
|
+
|
|
9
|
+
Breaking changes
|
|
10
|
+
----------------
|
|
11
|
+
|
|
12
|
+
- Drop support for load parameter from client fixtures. This can be easily replaced by creating intermediary fixture between test and client fixture. (`#1087 <https://github.com/dbfixtures/pytest-postgresql/issues/1087>`__)
|
|
13
|
+
- Stop supporting Python 3.8 as it already reached EOL
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Bugfixes
|
|
17
|
+
--------
|
|
18
|
+
|
|
19
|
+
- Passing all environment variables to the initdb.
|
|
20
|
+
|
|
21
|
+
This helps the cases where og_ctl is replaced by custom shell script
|
|
22
|
+
making additional calls, and needs all the variables, that ie server process gets. (`#1076 <https://github.com/dbfixtures/pytest-postgresql/issues/1076>`__)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Features
|
|
26
|
+
--------
|
|
27
|
+
|
|
28
|
+
- If a test run ended in an error that prevented proper test cleanup,
|
|
29
|
+
developer can now use `--postgresql-drop-test-database` command line flag,
|
|
30
|
+
to delete database from noproc fixture at the start. (`#265 <https://github.com/dbfixtures/pytest-postgresql/issues/265>`__)
|
|
31
|
+
- DatabaseJanitor.cursor now accepts optional parameter dbname, which defaults to `postgres`
|
|
32
|
+
|
|
33
|
+
This database name is used to make connection to and return a cursor. (`#265 <https://github.com/dbfixtures/pytest-postgresql/issues/265>`__)
|
|
34
|
+
- When running tests with xdist, pytest-postgresql now attempts to detect random ports
|
|
35
|
+
selected by other nodes by writing down a .port file in session temporary directory.
|
|
36
|
+
|
|
37
|
+
The number of tries it attempts to select unused port is configurable,
|
|
38
|
+
and defaults to 0.
|
|
39
|
+
|
|
40
|
+
In case pytest-postgresql won't be able to select unused port,
|
|
41
|
+
PortForException is thrown with appropriate message. (`#872 <https://github.com/dbfixtures/pytest-postgresql/issues/872>`__)
|
|
42
|
+
- Mark Python 3.13 as supported.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
Miscellaneus
|
|
46
|
+
------------
|
|
47
|
+
|
|
48
|
+
- `#707 <https://github.com/dbfixtures/pytest-postgresql/issues/707>`__, `#895 <https://github.com/dbfixtures/pytest-postgresql/issues/895>`__, `#1047 <https://github.com/dbfixtures/pytest-postgresql/issues/1047>`__, `#1048 <https://github.com/dbfixtures/pytest-postgresql/issues/1048>`__, `#1055 <https://github.com/dbfixtures/pytest-postgresql/issues/1055>`__, `#1061 <https://github.com/dbfixtures/pytest-postgresql/issues/1061>`__, `#1062 <https://github.com/dbfixtures/pytest-postgresql/issues/1062>`__, `#1063 <https://github.com/dbfixtures/pytest-postgresql/issues/1063>`__, `#1081 <https://github.com/dbfixtures/pytest-postgresql/issues/1081>`__
|
|
49
|
+
- Add PostgreSQL 17 to CI and drop 12
|
|
50
|
+
- Add [bot] suffix to the pre-commit actor.
|
|
51
|
+
- Adjust links after repository transfer
|
|
52
|
+
- Adjust workflows for actions-reuse 3.0.1
|
|
53
|
+
- Fix DatabaseJanitor documentation.
|
|
54
|
+
- In Python 3.13, usage of a positional argument for `maxsplit` has been
|
|
55
|
+
formally deprecated.
|
|
56
|
+
Update code to use keyword argument `maxsplit` instead of positional.
|
|
57
|
+
- Skip local hooks from ci
|
|
58
|
+
- Skip newsfragment checks for pre-commit actor.
|
|
59
|
+
- Update pre-commit configuration to use ruff instead of flake8/pydocstyle
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
6.1.1 (2024-09-05)
|
|
63
|
+
==================
|
|
64
|
+
|
|
65
|
+
Bugfixes
|
|
66
|
+
--------
|
|
67
|
+
|
|
68
|
+
- Set minimum version of `port-for` dependecy in pyproject.toml for client installations. (`#1015 <https://github.com/dbfixtures/pytest-postgresql/issues/1015>`__)
|
|
69
|
+
|
|
70
|
+
|
|
6
71
|
6.1.0 (2024-09-04)
|
|
7
72
|
==================
|
|
8
73
|
|
|
9
74
|
Features
|
|
10
75
|
--------
|
|
11
76
|
|
|
12
|
-
- add support for \\ character in pytest temporary path (`#982 <https://github.com/
|
|
77
|
+
- add support for \\ character in pytest temporary path (`#982 <https://github.com/dbfixtures/pytest-postgresql/issues/982>`__)
|
|
13
78
|
|
|
14
79
|
|
|
15
80
|
Miscellaneus
|
|
16
81
|
------------
|
|
17
82
|
|
|
18
|
-
- Add test for `PR #965 <https://github.com/
|
|
83
|
+
- Add test for `PR #965 <https://github.com/dbfixtures/pytest-postgresql/pull/965>`_
|
|
19
84
|
- refactors test_executor.py to enable Mac
|
|
20
85
|
|
|
21
86
|
|
|
@@ -26,13 +91,13 @@ Bugfixes
|
|
|
26
91
|
--------
|
|
27
92
|
|
|
28
93
|
- Fixed a long-standing bug, where calls to pg_ctl weren't getting `LC_*` and `LANG` envvars,
|
|
29
|
-
which caused issues on some systems not recognizing --auth parameter. (`#343 <https://github.com/
|
|
94
|
+
which caused issues on some systems not recognizing --auth parameter. (`#343 <https://github.com/dbfixtures/pytest-postgresql/issues/343>`__)
|
|
30
95
|
|
|
31
96
|
|
|
32
97
|
Miscellaneus
|
|
33
98
|
------------
|
|
34
99
|
|
|
35
|
-
- `#945 <https://github.com/
|
|
100
|
+
- `#945 <https://github.com/dbfixtures/pytest-postgresql/issues/945>`__
|
|
36
101
|
|
|
37
102
|
|
|
38
103
|
6.0.0 (2024-03-11)
|
|
@@ -41,13 +106,13 @@ Miscellaneus
|
|
|
41
106
|
Breaking changes
|
|
42
107
|
----------------
|
|
43
108
|
|
|
44
|
-
- DatabaseJanitor class now accepts only keyword arguments. (`#899 <https://github.com/
|
|
109
|
+
- DatabaseJanitor class now accepts only keyword arguments. (`#899 <https://github.com/dbfixtures/pytest-postgresql/issues/899>`__)
|
|
45
110
|
|
|
46
111
|
|
|
47
112
|
Bugfixes
|
|
48
113
|
--------
|
|
49
114
|
|
|
50
|
-
- Fix the remaining `DepcrecationWarning` for `datetime.datetime.utcnow` on Python 3.12. (`#896 <https://github.com/
|
|
115
|
+
- Fix the remaining `DepcrecationWarning` for `datetime.datetime.utcnow` on Python 3.12. (`#896 <https://github.com/dbfixtures/pytest-postgresql/issues/896>`__)
|
|
51
116
|
|
|
52
117
|
|
|
53
118
|
Deprecations
|
|
@@ -56,7 +121,7 @@ Deprecations
|
|
|
56
121
|
- Deprecated load parameter on a client fixture.
|
|
57
122
|
Developers are encouraged to either use the load function/parameter
|
|
58
123
|
for process fixture, or create an intermediate fixture placed between client
|
|
59
|
-
and tests themselves to fill in the data. (`#850 <https://github.com/
|
|
124
|
+
and tests themselves to fill in the data. (`#850 <https://github.com/dbfixtures/pytest-postgresql/issues/850>`__)
|
|
60
125
|
|
|
61
126
|
|
|
62
127
|
Features
|
|
@@ -64,18 +129,18 @@ Features
|
|
|
64
129
|
|
|
65
130
|
- Now all sql files used to initialise database for tests, has to be passed as pathlib.Path instance.
|
|
66
131
|
|
|
67
|
-
This helps the DatabaseJanitor choose correct behaviour based on parameter. (`#638 <https://github.com/
|
|
132
|
+
This helps the DatabaseJanitor choose correct behaviour based on parameter. (`#638 <https://github.com/dbfixtures/pytest-postgresql/issues/638>`__)
|
|
68
133
|
- Have separate parameters for template database name and database name in DatabaseJanitor.
|
|
69
|
-
It'll make it much clearer to understand the code and Janitor's behaviour. (`#672 <https://github.com/
|
|
134
|
+
It'll make it much clearer to understand the code and Janitor's behaviour. (`#672 <https://github.com/dbfixtures/pytest-postgresql/issues/672>`__)
|
|
70
135
|
- Template databases are now created with is_template flag turned on, and not by setting allow_connections to false.
|
|
71
136
|
|
|
72
|
-
The allow_connections flag being set to false is used strictly right before we attempt to drop the database. (`#914 <https://github.com/
|
|
137
|
+
The allow_connections flag being set to false is used strictly right before we attempt to drop the database. (`#914 <https://github.com/dbfixtures/pytest-postgresql/issues/914>`__)
|
|
73
138
|
|
|
74
139
|
|
|
75
140
|
Miscellaneus
|
|
76
141
|
------------
|
|
77
142
|
|
|
78
|
-
- `#865 <https://github.com/
|
|
143
|
+
- `#865 <https://github.com/dbfixtures/pytest-postgresql/issues/865>`__, `#882 <https://github.com/dbfixtures/pytest-postgresql/issues/882>`__, `#893 <https://github.com/dbfixtures/pytest-postgresql/issues/893>`__, `#900 <https://github.com/dbfixtures/pytest-postgresql/issues/900>`__
|
|
79
144
|
|
|
80
145
|
|
|
81
146
|
5.1.1 (2024-03-07)
|
|
@@ -84,7 +149,7 @@ Miscellaneus
|
|
|
84
149
|
Miscellaneus
|
|
85
150
|
------------
|
|
86
151
|
|
|
87
|
-
- Add missing python 3.12 classifier to pythin package. (`#915 <https://github.com/
|
|
152
|
+
- Add missing python 3.12 classifier to pythin package. (`#915 <https://github.com/dbfixtures/pytest-postgresql/issues/915>`__)
|
|
88
153
|
|
|
89
154
|
|
|
90
155
|
5.1.0 (2024-01-29)
|
|
@@ -93,26 +158,26 @@ Miscellaneus
|
|
|
93
158
|
Bugfixes
|
|
94
159
|
--------
|
|
95
160
|
|
|
96
|
-
- Update postgresql_load default value for it to fallback into the empty list (`#881 <https://github.com/
|
|
161
|
+
- Update postgresql_load default value for it to fallback into the empty list (`#881 <https://github.com/dbfixtures/pytest-postgresql/issues/881>`__)
|
|
97
162
|
|
|
98
163
|
|
|
99
164
|
Features
|
|
100
165
|
--------
|
|
101
166
|
|
|
102
|
-
- Support for Python 3.12 (`#835 <https://github.com/
|
|
167
|
+
- Support for Python 3.12 (`#835 <https://github.com/dbfixtures/pytest-postgresql/issues/835>`__)
|
|
103
168
|
|
|
104
169
|
|
|
105
170
|
Miscellaneus
|
|
106
171
|
------------
|
|
107
172
|
|
|
108
|
-
- Removed misleading parapgraph from one example in a README (`#688 <https://github.com/
|
|
109
|
-
- Fixed typing exceptions for mypy 1.4 (`#765 <https://github.com/
|
|
110
|
-
- README: fix section markup (`#771 <https://github.com/
|
|
111
|
-
- Add SQLAlchemy example for initialising common database state. (`#797 <https://github.com/
|
|
173
|
+
- Removed misleading parapgraph from one example in a README (`#688 <https://github.com/dbfixtures/pytest-postgresql/issues/688>`__)
|
|
174
|
+
- Fixed typing exceptions for mypy 1.4 (`#765 <https://github.com/dbfixtures/pytest-postgresql/issues/765>`__)
|
|
175
|
+
- README: fix section markup (`#771 <https://github.com/dbfixtures/pytest-postgresql/issues/771>`__, `#776 <https://github.com/dbfixtures/pytest-postgresql/issues/776>`__)
|
|
176
|
+
- Add SQLAlchemy example for initialising common database state. (`#797 <https://github.com/dbfixtures/pytest-postgresql/issues/797>`__)
|
|
112
177
|
- Rely on cached/artifacted Pipfile.lock.
|
|
113
|
-
That way, it will be specifically defined for given python version/system. (`#834 <https://github.com/
|
|
114
|
-
- CI Change - Add PostgreSQL 16, drop PostgreSQL 11 (`#836 <https://github.com/
|
|
115
|
-
- Replace usage of `pkg_resources.parse_version` with `packaging.version.parse` (`#858 <https://github.com/
|
|
178
|
+
That way, it will be specifically defined for given python version/system. (`#834 <https://github.com/dbfixtures/pytest-postgresql/issues/834>`__)
|
|
179
|
+
- CI Change - Add PostgreSQL 16, drop PostgreSQL 11 (`#836 <https://github.com/dbfixtures/pytest-postgresql/issues/836>`__)
|
|
180
|
+
- Replace usage of `pkg_resources.parse_version` with `packaging.version.parse` (`#858 <https://github.com/dbfixtures/pytest-postgresql/issues/858>`__)
|
|
116
181
|
|
|
117
182
|
|
|
118
183
|
5.0.0 (2023-05-20)
|
|
@@ -121,7 +186,7 @@ Miscellaneus
|
|
|
121
186
|
Breaking changes
|
|
122
187
|
----------------
|
|
123
188
|
|
|
124
|
-
- Drop support for Python 3.7 (`#706 <https://github.com/
|
|
189
|
+
- Drop support for Python 3.7 (`#706 <https://github.com/dbfixtures/pytest-postgresql/issues/706>`__)
|
|
125
190
|
- psycopg is now a mandatory requirement.
|
|
126
191
|
With pyscop2 it was optional due to the different ways it could be installed:
|
|
127
192
|
|
|
@@ -129,32 +194,32 @@ Breaking changes
|
|
|
129
194
|
* psycopg2-binary - binary distribution
|
|
130
195
|
* psycopg2cffi - pypy enabled version
|
|
131
196
|
|
|
132
|
-
Since psycopg version 3 there's only one package to install. (`#744 <https://github.com/
|
|
133
|
-
- Dropped --postgresql-logsprefix/postgresql_logsprefix options. All fixture data is already distinguished by tmpdir itself. (`#748 <https://github.com/
|
|
197
|
+
Since psycopg version 3 there's only one package to install. (`#744 <https://github.com/dbfixtures/pytest-postgresql/issues/744>`__)
|
|
198
|
+
- Dropped --postgresql-logsprefix/postgresql_logsprefix options. All fixture data is already distinguished by tmpdir itself. (`#748 <https://github.com/dbfixtures/pytest-postgresql/issues/748>`__)
|
|
134
199
|
|
|
135
200
|
|
|
136
201
|
Features
|
|
137
202
|
--------
|
|
138
203
|
|
|
139
|
-
- Re-rise FileNotFound errors with more meaningful messages. (`#598 <https://github.com/
|
|
140
|
-
- Support Python 3.11 (`#678 <https://github.com/
|
|
204
|
+
- Re-rise FileNotFound errors with more meaningful messages. (`#598 <https://github.com/dbfixtures/pytest-postgresql/issues/598>`__)
|
|
205
|
+
- Support Python 3.11 (`#678 <https://github.com/dbfixtures/pytest-postgresql/issues/678>`__)
|
|
141
206
|
|
|
142
207
|
|
|
143
208
|
Miscellaneus
|
|
144
209
|
------------
|
|
145
210
|
|
|
146
|
-
- Drop PyPy from CI (`#669 <https://github.com/
|
|
147
|
-
- pytest-postgresql will now recognise and use development postgresql versions (`#691 <https://github.com/
|
|
148
|
-
- Use towncrier to maintain project's newsfragments/changelog (`#700 <https://github.com/
|
|
149
|
-
- Move project dependency management to pipenv (`#701 <https://github.com/
|
|
150
|
-
- Migrate to shared automerge workflow for automatic tests dependency updates (`#702 <https://github.com/
|
|
151
|
-
- Use tbump instead of bumpversion to manage versioning and releases. (`#703 <https://github.com/
|
|
152
|
-
- Move most of package configuration to pyproject.toml (`#704 <https://github.com/
|
|
153
|
-
- Introduce Typed config dict (`#706 <https://github.com/
|
|
154
|
-
- Use ankane/setup-postgres@v1 to setup postgresql in CI instead of custom scripts. (`#708 <https://github.com/
|
|
155
|
-
- Pass codecov_token to codecov action to upload coverage. (`#721 <https://github.com/
|
|
156
|
-
- Replaced flake8 and pydocstyle with ruff, turned on isort rules (`#735 <https://github.com/
|
|
157
|
-
- Split single bid test job into smaller running each after another. (`#740 <https://github.com/
|
|
211
|
+
- Drop PyPy from CI (`#669 <https://github.com/dbfixtures/pytest-postgresql/issues/669>`__)
|
|
212
|
+
- pytest-postgresql will now recognise and use development postgresql versions (`#691 <https://github.com/dbfixtures/pytest-postgresql/issues/691>`__)
|
|
213
|
+
- Use towncrier to maintain project's newsfragments/changelog (`#700 <https://github.com/dbfixtures/pytest-postgresql/issues/700>`__)
|
|
214
|
+
- Move project dependency management to pipenv (`#701 <https://github.com/dbfixtures/pytest-postgresql/issues/701>`__)
|
|
215
|
+
- Migrate to shared automerge workflow for automatic tests dependency updates (`#702 <https://github.com/dbfixtures/pytest-postgresql/issues/702>`__)
|
|
216
|
+
- Use tbump instead of bumpversion to manage versioning and releases. (`#703 <https://github.com/dbfixtures/pytest-postgresql/issues/703>`__)
|
|
217
|
+
- Move most of package configuration to pyproject.toml (`#704 <https://github.com/dbfixtures/pytest-postgresql/issues/704>`__)
|
|
218
|
+
- Introduce Typed config dict (`#706 <https://github.com/dbfixtures/pytest-postgresql/issues/706>`__)
|
|
219
|
+
- Use ankane/setup-postgres@v1 to setup postgresql in CI instead of custom scripts. (`#708 <https://github.com/dbfixtures/pytest-postgresql/issues/708>`__)
|
|
220
|
+
- Pass codecov_token to codecov action to upload coverage. (`#721 <https://github.com/dbfixtures/pytest-postgresql/issues/721>`__)
|
|
221
|
+
- Replaced flake8 and pydocstyle with ruff, turned on isort rules (`#735 <https://github.com/dbfixtures/pytest-postgresql/issues/735>`__)
|
|
222
|
+
- Split single bid test job into smaller running each after another. (`#740 <https://github.com/dbfixtures/pytest-postgresql/issues/740>`__)
|
|
158
223
|
|
|
159
224
|
|
|
160
225
|
4.1.1
|
|
@@ -165,7 +230,7 @@ Misc
|
|
|
165
230
|
|
|
166
231
|
- Error message typo fix
|
|
167
232
|
- Docker documentation example typo fixes
|
|
168
|
-
- Have setuptools required as package dependency. pkg_resources.parse_version is used in code
|
|
233
|
+
- Have setuptools required as package dependency. pkg_resources.parse_version is used in code
|
|
169
234
|
but setuptools was only used as build requirements
|
|
170
235
|
|
|
171
236
|
4.1.0
|
|
@@ -305,7 +370,7 @@ Bugfix
|
|
|
305
370
|
2.6.0
|
|
306
371
|
=====
|
|
307
372
|
|
|
308
|
-
- [enhancement] add ability to pass options to pg_ctl's -o flag to send arguments to the underlying postgres executable
|
|
373
|
+
- [enhancement] add ability to pass options to pg_ctl's -o flag to send arguments to the underlying postgres executable
|
|
309
374
|
Use `postgres_options` as fixture argument, `--postgresql-postgres-options` as pytest starting option or
|
|
310
375
|
`postgresql_postgres_options` as pytest.ini configuration option
|
|
311
376
|
|
|
@@ -355,7 +420,7 @@ Bugfix
|
|
|
355
420
|
=====
|
|
356
421
|
|
|
357
422
|
- [feature] Allow to set password for postgresql. Use it throughout the flow.
|
|
358
|
-
- [bugfix] Default Janitor's connections to postgres database. When using custom users,
|
|
423
|
+
- [bugfix] Default Janitor's connections to postgres database. When using custom users,
|
|
359
424
|
postgres attempts to use user's database and it might not exist.
|
|
360
425
|
- [bugfix] NoopExecutor connects to read version by context manager to properly handle cases
|
|
361
426
|
where it can't connect to the server.
|
|
@@ -390,7 +455,7 @@ Bugfix
|
|
|
390
455
|
1.4.1
|
|
391
456
|
=====
|
|
392
457
|
|
|
393
|
-
- [bugfix] Allow creating test database with hyphens
|
|
458
|
+
- [bugfix] Allow creating test database with hyphens
|
|
394
459
|
|
|
395
460
|
1.4.0
|
|
396
461
|
=====
|
|
@@ -19,7 +19,13 @@ Feature requests/proposals
|
|
|
19
19
|
#. Provide as detailed description as possible
|
|
20
20
|
* Use case is great to have
|
|
21
21
|
#. There'll be a bit of discussion for the feature. Don't worry, if it is to be accepted, we'd like to support it, so we need to understand it thoroughly.
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
Development
|
|
24
|
+
-----------
|
|
25
|
+
|
|
26
|
+
#. Fork the repository
|
|
27
|
+
#. Clone the repository
|
|
28
|
+
#. Create a virtual environment with ``pipenv install --dev``
|
|
23
29
|
|
|
24
30
|
Pull requests
|
|
25
31
|
-------------
|
|
@@ -40,13 +46,17 @@ Commits
|
|
|
40
46
|
Coding style
|
|
41
47
|
------------
|
|
42
48
|
|
|
43
|
-
#. Coding style is being handled by black and doublechecked by
|
|
49
|
+
#. Coding style is being handled by black and doublechecked by ruff.
|
|
44
50
|
* We provide a `pre-commit <https://pre-commit.com/>`_ configuration for invoking these on commit.
|
|
45
51
|
|
|
46
52
|
Testing
|
|
47
53
|
-------
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
#. Tests are written using `pytest <https://docs.pytest.org/>`_
|
|
56
|
+
#. PR tests run on Github Actions.
|
|
57
|
+
#. Run a PostgreSQL server [#]_, and create a default super user ``createuser --superuser postgres``
|
|
58
|
+
#. Set envvar named ``POSTGRES`` with used version number
|
|
59
|
+
#. Run tests with ``pipenv run pytest``
|
|
60
|
+
#. If you encounter any test failures due to locale issues, make sure that both ``en_US.UTF-8`` and ``de_DE.UTF-8`` are enabled in ``/etc/locale.gen`` and then run ``sudo locale-gen``.
|
|
61
|
+
|
|
62
|
+
.. [#] Installing and configuring a PostgreSQL server is out of scope of this document. Please refer to `PostgreSQL documentation <https://www.postgresql.org/docs/>`_ for more information.
|
|
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
|
|
|
671
671
|
may consider it more useful to permit linking proprietary applications with
|
|
672
672
|
the library. If this is what you want to do, use the GNU Lesser General
|
|
673
673
|
Public License instead of this License. But first, please read
|
|
674
|
-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
674
|
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
@@ -162,4 +162,4 @@ General Public License ever published by the Free Software Foundation.
|
|
|
162
162
|
whether future versions of the GNU Lesser General Public License shall
|
|
163
163
|
apply, that proxy's public statement of acceptance of any version is
|
|
164
164
|
permanent authorization for you to choose that version for the
|
|
165
|
-
Library.
|
|
165
|
+
Library.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: pytest-postgresql
|
|
3
|
-
Version:
|
|
3
|
+
Version: 7.0.0
|
|
4
4
|
Summary: Postgresql fixtures and fixture factories for Pytest.
|
|
5
5
|
Author-email: Grzegorz Śliwiński <fizyk+pypi@fizyk.dev>
|
|
6
|
-
Project-URL: Source, https://github.com/
|
|
7
|
-
Project-URL: Bug Tracker, https://github.com/
|
|
8
|
-
Project-URL: Changelog, https://github.com/
|
|
6
|
+
Project-URL: Source, https://github.com/dbfixtures/pytest-postgresql
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/dbfixtures/pytest-postgresql/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/dbfixtures/pytest-postgresql/blob/v7.0.0/CHANGES.rst
|
|
9
9
|
Keywords: tests,pytest,fixture,postgresql
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Environment :: Web Environment
|
|
@@ -15,30 +15,30 @@ Classifier: Natural Language :: English
|
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
16
|
Classifier: Programming Language :: Python
|
|
17
17
|
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
23
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
25
|
Classifier: Topic :: Software Development :: Testing
|
|
26
26
|
Classifier: Framework :: Pytest
|
|
27
|
-
Requires-Python: >=3.
|
|
27
|
+
Requires-Python: >=3.9
|
|
28
28
|
Description-Content-Type: text/x-rst
|
|
29
29
|
License-File: COPYING
|
|
30
30
|
License-File: COPYING.lesser
|
|
31
31
|
License-File: AUTHORS.rst
|
|
32
32
|
Requires-Dist: pytest>=6.2
|
|
33
|
-
Requires-Dist: port-for>=0.
|
|
34
|
-
Requires-Dist: mirakuru
|
|
35
|
-
Requires-Dist:
|
|
33
|
+
Requires-Dist: port-for>=0.7.3
|
|
34
|
+
Requires-Dist: mirakuru>=2.6.0
|
|
35
|
+
Requires-Dist: packaging
|
|
36
36
|
Requires-Dist: psycopg>=3.0.0
|
|
37
37
|
|
|
38
|
-
.. image:: https://raw.githubusercontent.com/
|
|
38
|
+
.. image:: https://raw.githubusercontent.com/dbfixtures/pytest-postgresql/master/logo.png
|
|
39
39
|
:width: 100px
|
|
40
40
|
:height: 100px
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
pytest-postgresql
|
|
43
43
|
=================
|
|
44
44
|
|
|
@@ -122,38 +122,25 @@ Sample test
|
|
|
122
122
|
postgresql.commit()
|
|
123
123
|
cur.close()
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
Pre-populating the database for tests
|
|
126
|
+
-------------------------------------
|
|
126
127
|
|
|
127
|
-
|
|
128
|
-
#. process fixture specific
|
|
128
|
+
If you want the database fixture to be automatically pre-populated with your schema and data, there are two lewels you can achieve it:
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
#. per test in a client fixture, by an intermediary fixture between client and your test (or other fixtures)
|
|
131
|
+
#. per session in a process fixture
|
|
131
132
|
|
|
132
|
-
|
|
133
|
-
* loading function import path (string)
|
|
134
|
-
* actual loading function
|
|
133
|
+
The process fixture accepts a load parameter, which accepts these loaders:
|
|
135
134
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
* sql file path - which will load and execute sql files
|
|
136
|
+
* loading functions - either by string import path, actual callable.
|
|
137
|
+
Loading functions will receive **host**, **port**, **user**, **dbname** and **password** arguments and will have to perform
|
|
138
|
+
connection to the database inside. Or start session in the ORM of your choice to perform actions with given ORM.
|
|
139
|
+
This way, you'd be able to trigger ORM based data manipulations, or even trigger database migrations programmatically.
|
|
139
140
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
from pathlib import Path
|
|
145
|
-
postgresql_my_with_schema = factories.postgresql(
|
|
146
|
-
'postgresql_my_proc',
|
|
147
|
-
load=[Path("schemafile.sql"), Path("otherschema.sql"), "import.path.to.function", "import.path.to:otherfunction", load_this]
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
.. warning::
|
|
151
|
-
|
|
152
|
-
This way, the database will still be dropped each time.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
The process fixture performs the load once per test session, and loads the data into the template database.
|
|
156
|
-
Client fixture then creates test database out of the template database each test, which significantly **speeds up the tests**.
|
|
141
|
+
The process fixture pre-populates the database once per test session (at the start of the process fixture),
|
|
142
|
+
and loads the schema and data into the template database. Client fixture then creates test database out of the template database each test,
|
|
143
|
+
which significantly **speeds up the tests**.
|
|
157
144
|
|
|
158
145
|
.. code-block:: python
|
|
159
146
|
|
|
@@ -162,14 +149,15 @@ Client fixture then creates test database out of the template database each test
|
|
|
162
149
|
load=[Path("schemafile.sql"), Path("otherschema.sql"), "import.path.to.function", "import.path.to:otherfunction", load_this]
|
|
163
150
|
)
|
|
164
151
|
|
|
152
|
+
Additional benefit, is that test code might safely use separate database connection, and can safely test it's behaviour with transactions and rollbacks,
|
|
153
|
+
as tests and code will work on separate database connections.
|
|
154
|
+
|
|
155
|
+
Defining pre-populate on command line:
|
|
165
156
|
|
|
166
157
|
.. code-block:: sh
|
|
167
158
|
|
|
168
159
|
pytest --postgresql-populate-template=path.to.loading_function --postgresql-populate-template=path.to.other:loading_function --postgresql-populate-template=path/to/file.sql
|
|
169
160
|
|
|
170
|
-
|
|
171
|
-
The loading_function from example will receive , and have to commit that.
|
|
172
|
-
|
|
173
161
|
Connecting to already existing postgresql database
|
|
174
162
|
--------------------------------------------------
|
|
175
163
|
|
|
@@ -222,6 +210,12 @@ You can pick which you prefer, but remember that these settings are handled in t
|
|
|
222
210
|
- postgresql_port
|
|
223
211
|
- yes (5432)
|
|
224
212
|
- random
|
|
213
|
+
* - Port search count
|
|
214
|
+
-
|
|
215
|
+
- --postgresql-port-search-count
|
|
216
|
+
- postgresql_port_search_count
|
|
217
|
+
- -
|
|
218
|
+
- 5
|
|
225
219
|
* - postgresql user
|
|
226
220
|
- user
|
|
227
221
|
- --postgresql-user
|
|
@@ -270,6 +264,18 @@ You can pick which you prefer, but remember that these settings are handled in t
|
|
|
270
264
|
- postgresql_options
|
|
271
265
|
- yes
|
|
272
266
|
-
|
|
267
|
+
* - Drop test database on start.
|
|
268
|
+
|
|
269
|
+
.. warning::
|
|
270
|
+
|
|
271
|
+
Use carefully as it might lead to unexpected results within your test suite.
|
|
272
|
+
-
|
|
273
|
+
- --postgresql-drop-test-database
|
|
274
|
+
-
|
|
275
|
+
- false
|
|
276
|
+
-
|
|
277
|
+
|
|
278
|
+
|
|
273
279
|
|
|
274
280
|
|
|
275
281
|
Example usage:
|
|
@@ -385,11 +391,11 @@ For this import DatabaseJanitor and use its init and drop methods:
|
|
|
385
391
|
# variable definition
|
|
386
392
|
|
|
387
393
|
janitor = DatabaseJanitor(
|
|
388
|
-
postgresql_proc.user,
|
|
389
|
-
postgresql_proc.host,
|
|
390
|
-
postgresql_proc.port,
|
|
391
|
-
"my_test_database",
|
|
392
|
-
postgresql_proc.version,
|
|
394
|
+
user=postgresql_proc.user,
|
|
395
|
+
host=postgresql_proc.host,
|
|
396
|
+
proc=postgresql_proc.port,
|
|
397
|
+
testdb="my_test_database",
|
|
398
|
+
version=postgresql_proc.version,
|
|
393
399
|
password="secret_password",
|
|
394
400
|
)
|
|
395
401
|
janitor.init()
|
|
@@ -414,11 +420,11 @@ or use it as a context manager:
|
|
|
414
420
|
# variable definition
|
|
415
421
|
|
|
416
422
|
with DatabaseJanitor(
|
|
417
|
-
postgresql_proc.user,
|
|
418
|
-
postgresql_proc.host,
|
|
419
|
-
postgresql_proc.port,
|
|
420
|
-
"my_test_database",
|
|
421
|
-
postgresql_proc.version,
|
|
423
|
+
user=postgresql_proc.user,
|
|
424
|
+
host=postgresql_proc.host,
|
|
425
|
+
port=postgresql_proc.port,
|
|
426
|
+
dbname="my_test_database",
|
|
427
|
+
version=postgresql_proc.version,
|
|
422
428
|
password="secret_password",
|
|
423
429
|
):
|
|
424
430
|
yield psycopg2.connect(
|