summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradroullier <arndt@nive.co>2023-10-24 14:01:24 +0200
committeradroullier <arndt@nive.co>2023-10-24 14:05:35 +0200
commit74d675cea04335a17600a65bee8e0b0c5ca058a7 (patch)
treee674f484fbabc9ce359d42f2c3f9e5dbc8c2127e
parentcbdc4b9ad9bdb20a4e0ad17f9d5af26147b771f9 (diff)
downloadpyramid-74d675cea04335a17600a65bee8e0b0c5ca058a7.tar.gz
pyramid-74d675cea04335a17600a65bee8e0b0c5ca058a7.tar.bz2
pyramid-74d675cea04335a17600a65bee8e0b0c5ca058a7.zip
Fix 'tox -e lint' tests
-rw-r--r--src/pyramid/scripts/prequest.py2
-rw-r--r--src/pyramid/scripts/proutes.py2
-rw-r--r--src/pyramid/scripts/pserve.py2
-rw-r--r--src/pyramid/scripts/pshell.py2
-rw-r--r--src/pyramid/scripts/ptweens.py2
-rw-r--r--src/pyramid/scripts/pviews.py2
-rw-r--r--tests/test_scripts/test_prequest.py5
-rw-r--r--tests/test_scripts/test_pserve.py5
8 files changed, 14 insertions, 8 deletions
diff --git a/src/pyramid/scripts/prequest.py b/src/pyramid/scripts/prequest.py
index b7f148430..3db268896 100644
--- a/src/pyramid/scripts/prequest.py
+++ b/src/pyramid/scripts/prequest.py
@@ -138,7 +138,7 @@ class PRequestCommand:
config_uri = self.args.config_uri
config_vars = parse_vars(self.args.config_vars)
# bw update 2.1 don't overwrite if set
- if not '__script__' in config_vars:
+ if '__script__' not in config_vars:
config_vars['__script__'] = self.script_name
path = self.args.path_info
diff --git a/src/pyramid/scripts/proutes.py b/src/pyramid/scripts/proutes.py
index ec3075be6..fdafc6880 100644
--- a/src/pyramid/scripts/proutes.py
+++ b/src/pyramid/scripts/proutes.py
@@ -318,7 +318,7 @@ class PRoutesCommand:
config_uri = self.args.config_uri
config_vars = parse_vars(self.args.config_vars)
# bw update 2.1 don't overwrite if set
- if not '__script__' in config_vars:
+ if '__script__' not in config_vars:
config_vars['__script__'] = self.script_name
loader = self.get_config_loader(config_uri)
loader.setup_logging(config_vars)
diff --git a/src/pyramid/scripts/pserve.py b/src/pyramid/scripts/pserve.py
index 48048f893..55878c3fa 100644
--- a/src/pyramid/scripts/pserve.py
+++ b/src/pyramid/scripts/pserve.py
@@ -185,7 +185,7 @@ class PServeCommand:
config_uri = self.args.config_uri
config_vars = parse_vars(self.args.config_vars)
# bw update 2.1 don't overwrite if set
- if not '__script__' in config_vars:
+ if '__script__' not in config_vars:
config_vars['__script__'] = self.script_name
app_spec = self.args.config_uri
app_name = self.args.app_name
diff --git a/src/pyramid/scripts/pshell.py b/src/pyramid/scripts/pshell.py
index c5e5c2fb2..ba51745f3 100644
--- a/src/pyramid/scripts/pshell.py
+++ b/src/pyramid/scripts/pshell.py
@@ -132,7 +132,7 @@ class PShellCommand:
config_uri = self.args.config_uri
config_vars = parse_vars(self.args.config_vars)
# bw update 2.1 don't overwrite if set
- if not '__script__' in config_vars:
+ if '__script__' not in config_vars:
config_vars['__script__'] = self.script_name
loader = self.get_config_loader(config_uri)
loader.setup_logging(config_vars)
diff --git a/src/pyramid/scripts/ptweens.py b/src/pyramid/scripts/ptweens.py
index ca8469169..1722d9261 100644
--- a/src/pyramid/scripts/ptweens.py
+++ b/src/pyramid/scripts/ptweens.py
@@ -83,7 +83,7 @@ class PTweensCommand:
config_uri = self.args.config_uri
config_vars = parse_vars(self.args.config_vars)
# bw update 2.1 don't overwrite if set
- if not '__script__' in config_vars:
+ if '__script__' not in config_vars:
config_vars['__script__'] = self.script_name
self.setup_logging(config_uri, global_conf=config_vars)
env = self.bootstrap(config_uri, options=config_vars)
diff --git a/src/pyramid/scripts/pviews.py b/src/pyramid/scripts/pviews.py
index da9881434..94c843821 100644
--- a/src/pyramid/scripts/pviews.py
+++ b/src/pyramid/scripts/pviews.py
@@ -250,7 +250,7 @@ class PViewsCommand:
config_uri = self.args.config_uri
config_vars = parse_vars(self.args.config_vars)
# bw update 2.1 don't overwrite if set
- if not '__script__' in config_vars:
+ if '__script__' not in config_vars:
config_vars['__script__'] = self.script_name
url = self.args.url
diff --git a/tests/test_scripts/test_prequest.py b/tests/test_scripts/test_prequest.py
index 97786ec83..d13010d5b 100644
--- a/tests/test_scripts/test_prequest.py
+++ b/tests/test_scripts/test_prequest.py
@@ -241,7 +241,10 @@ class TestPRequestCommand(unittest.TestCase):
def test_command_script_name(self):
command = self._makeOne(['', '--method=GET', 'development.ini', '/'],)
command.run()
- self.assertEqual(self.loader.calls[0]['defaults']['__script__'], 'prequest')
+ self.assertEqual(
+ self.loader.calls[0]['defaults']['__script__'],
+ 'prequest'
+ )
class Test_main(unittest.TestCase):
diff --git a/tests/test_scripts/test_pserve.py b/tests/test_scripts/test_pserve.py
index 0b010692a..bdc225c5e 100644
--- a/tests/test_scripts/test_pserve.py
+++ b/tests/test_scripts/test_pserve.py
@@ -47,7 +47,10 @@ class TestPServeCommand(unittest.TestCase):
self.loader.server = lambda x: x
inst.run()
- self.assertEqual(app.global_conf, {'a': '1', 'b': '2', '__script__': 'pserve'})
+ self.assertEqual(
+ app.global_conf,
+ {'a': '1', 'b': '2', '__script__': 'pserve'}
+ )
def test_original_ignore_files(self):
msg = 'A change to "ignore_files" was detected'