Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
099c36d5
Kaydet (Commit)
099c36d5
authored
Şub 05, 2019
tarafından
Jon Dufresne
Kaydeden (comit)
Tim Graham
Şub 05, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced manual current directory management with subprocess's cwd argument.
üst
4d425abc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
tests.py
tests/admin_scripts/tests.py
+2
-8
test_integration.py
tests/postgres_tests/test_integration.py
+1
-3
No files found.
tests/admin_scripts/tests.py
Dosyayı görüntüle @
099c36d5
...
...
@@ -128,7 +128,6 @@ class AdminScriptTestCase(SimpleTestCase):
# Define a temporary environment for the subprocess
test_environ
=
os
.
environ
.
copy
()
old_cwd
=
os
.
getcwd
()
# Set the test environment
if
settings_file
:
...
...
@@ -140,17 +139,12 @@ class AdminScriptTestCase(SimpleTestCase):
test_environ
[
'PYTHONPATH'
]
=
os
.
pathsep
.
join
(
python_path
)
test_environ
[
'PYTHONWARNINGS'
]
=
''
# Move to the test directory and run
os
.
chdir
(
self
.
test_dir
)
out
,
err
=
subprocess
.
Popen
(
return
subprocess
.
Popen
(
[
sys
.
executable
,
script
]
+
args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
cwd
=
self
.
test_dir
,
env
=
test_environ
,
universal_newlines
=
True
,
)
.
communicate
()
# Move back to the old working directory
os
.
chdir
(
old_cwd
)
return
out
,
err
def
run_django_admin
(
self
,
args
,
settings_file
=
None
):
script_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
django
.
__file__
),
'bin'
))
...
...
tests/postgres_tests/test_integration.py
Dosyayı görüntüle @
099c36d5
...
...
@@ -7,13 +7,11 @@ from . import PostgreSQLSimpleTestCase
class
PostgresIntegrationTests
(
PostgreSQLSimpleTestCase
):
def
test_check
(
self
):
old_cwd
=
os
.
getcwd
()
self
.
addCleanup
(
lambda
:
os
.
chdir
(
old_cwd
))
os
.
chdir
(
os
.
path
.
dirname
(
__file__
))
result
=
subprocess
.
run
(
[
sys
.
executable
,
'-m'
,
'django'
,
'check'
,
'--settings'
,
'integration_settings'
],
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
PIPE
,
cwd
=
os
.
path
.
dirname
(
__file__
),
)
stderr
=
'
\n
'
.
join
([
e
.
decode
()
for
e
in
result
.
stderr
.
splitlines
()])
self
.
assertEqual
(
result
.
returncode
,
0
,
msg
=
stderr
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment