forked from yanchunhuo/AutomationTest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
14 changed files
with
193 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
*nohup.out* | ||
*uwsgi.pid* | ||
*.pytest_cache* | ||
*pytest.ini* | ||
*common/java/lib/java/libs/* | ||
*config/app_ui_tmp/* | ||
*.vscode* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# @Author : yanchunhuo | ||
# @Time : 2020/1/15 16:25 | ||
|
||
from multiprocessing.pool import Pool | ||
import multiprocessing | ||
|
||
class NoDaemonProcess(multiprocessing.Process): | ||
""" | ||
重构multiprocessing.Process类,将进程始终定义为非守护进程 | ||
""" | ||
def _get_daemon(self): | ||
""" | ||
总返回非守护进程属性值 | ||
""" | ||
return False | ||
|
||
def _set_daemon(self, value): | ||
pass | ||
|
||
daemon = property(_get_daemon, _set_daemon) | ||
|
||
class Custom_Pool(Pool): | ||
""" | ||
重构multiprocessing.Pool类 | ||
""" | ||
Process = NoDaemonProcess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# @Author : yanchunhuo | ||
# @Time : 2020/1/15 14:08 | ||
import platform | ||
|
||
def deal_pytest_ini_file(): | ||
""" | ||
由于当前(2020/1/15)pytest运行指定的pytest.ini在Windows下编码有bug,故对不同环境进行处理 | ||
""" | ||
with open('config/pytest.conf','r',encoding='utf-8') as pytest_f: | ||
content=pytest_f.read() | ||
if 'Windows'==platform.system(): | ||
with open('config/pytest.ini','w+',encoding='gbk') as tmp_pytest_f: | ||
tmp_pytest_f.write(content) | ||
tmp_pytest_f.close() | ||
else: | ||
with open('config/pytest.ini','w+',encoding='utf-8') as tmp_pytest_f: | ||
tmp_pytest_f.write(content) | ||
tmp_pytest_f.close() | ||
pytest_f.close() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.