Skip to content

Commit 19e7cf5

Browse files
committed
Remove further path/path.py usage
1 parent b274dd8 commit 19e7cf5

File tree

3 files changed

+20
-28
lines changed

3 files changed

+20
-28
lines changed

pytest-devpi-server/_pytest_devpi_server/__init__.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import logging
1010
from six.moves import cStringIO
1111

12-
import pkg_resources
1312
from pytest import yield_fixture, fixture
1413
import devpi_server as _devpi_server
1514
from devpi.main import main as devpi_client
@@ -20,16 +19,16 @@
2019

2120
@yield_fixture(scope='session')
2221
def devpi_server(request):
23-
""" Session-scoped Devpi server run in a subprocess, out of a temp dir.
22+
""" Session-scoped Devpi server run in a subprocess, out of a temp dir.
2423
Out-of-the-box it creates a single user an index for that user, then
2524
uses that index.
26-
25+
2726
Methods
2827
-------
29-
api(): Client API method, directly bound to the devpi-client command-line tool. Examples:
28+
api(): Client API method, directly bound to the devpi-client command-line tool. Examples:
3029
... api('index', '-c', 'myindex') to create an index called 'myindex'
3130
... api('getjson', '/user/myindex') to return the json string describing this index
32-
31+
3332
Attributes
3433
----------
3534
uri: Server URI
@@ -38,9 +37,9 @@ def devpi_server(request):
3837
index: Initially created index name
3938
server_dir: Path to server database
4039
client_dir: Path to client directory
41-
42-
.. also inherits all attributes from the `workspace` fixture
43-
40+
41+
.. also inherits all attributes from the `workspace` fixture
42+
4443
For more fine-grained control over these attributes, use the class directly and pass in
4544
constructor arguments.
4645
"""
@@ -51,7 +50,7 @@ def devpi_server(request):
5150

5251
@fixture
5352
def devpi_function_index(request, devpi_server):
54-
""" Creates and activates an index for your current test function.
53+
""" Creates and activates an index for your current test function.
5554
"""
5655
index_name = '/'.join((devpi_server.user, request.function.__name__))
5756
devpi_server.api('index', '-c', index_name)
@@ -70,7 +69,7 @@ def __init__(self, offline=True, debug=False, data=None, user="testuser", passwo
7069
Run in offline mode. Defaults to True
7170
data: `str`
7271
Filesystem path to a zipfile archive of the initial server data directory.
73-
If not set and in offline mode, it uses a pre-canned snapshot of a
72+
If not set and in offline mode, it uses a pre-canned snapshot of a
7473
newly-created empty server.
7574
"""
7675
self.debug = debug

pytest-pyramid-server/pytest_pyramid_server.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
import shutil
1212
import threading
1313

14-
try:
15-
from path import Path
16-
except ImportError:
17-
from path import path as Path
14+
from pathlib import Path
1815

1916
from wsgiref.simple_server import make_server
2017
from paste.deploy.loadwsgi import loadapp
@@ -30,28 +27,28 @@ class ConfigNotFoundError(Exception):
3027

3128
@yield_fixture(scope='session')
3229
def pyramid_server(request):
33-
""" Session-scoped Pyramid server run in a subprocess, out of a temp dir.
30+
""" Session-scoped Pyramid server run in a subprocess, out of a temp dir.
3431
This is a 'real' server that you can point a Selenium webdriver at.
35-
32+
3633
This fixture searches for its configuration in the current working directory
3734
called 'testing.ini'. All .ini files in the cwd will be copied to the tempdir
38-
so that config chaining still works.
39-
35+
so that config chaining still works.
36+
4037
The fixture implementation in `PyramidTestServer` has more flexible configuration
41-
options, use it directly to define more fine-grained fixtures.
42-
38+
options, use it directly to define more fine-grained fixtures.
39+
4340
Methods
4441
-------
4542
get_config() : Return current configuration as a dict.
4643
get() : Query url relative to the server root.
4744
.. Retry failures by default.
4845
post() : Post payload to url relative to the server root.
4946
.. Retry failures by default.
50-
47+
5148
Attributes
5249
----------
5350
working_config (`path.path`): Path to the config file used by the server at runtime
54-
.. also inherits all attributes from the `workspace` fixture
51+
.. also inherits all attributes from the `workspace` fixture
5552
"""
5653
with PyramidTestServer() as server:
5754
server.start()
@@ -97,7 +94,7 @@ def pre_setup(self):
9794
for filename in glob.glob(os.path.join(self.config_dir, '*.ini')):
9895
shutil.copy(filename, self.workspace)
9996

100-
Path.copy(self.original_config, self.working_config)
97+
shutil.copy(str(self.original_config), str(self.working_config))
10198

10299
parser = configparser.ConfigParser()
103100
parser.read(self.original_config)

pytest-server-fixtures/pytest_server_fixtures/httpd.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import os
22
import platform
3-
import socket
43
import string
54
import logging
65

76
import pytest
8-
try:
9-
from path import Path
10-
except ImportError:
11-
from path import path as Path
7+
from pathlib import Path
128

139
from pytest_fixture_config import yield_requires_config
1410
from pytest_server_fixtures import CONFIG

0 commit comments

Comments
 (0)