##// END OF EJS Templates
run-tests: remove --py3-warnings...
Gregory Szorc -
r44602:bd0de73c default
parent child Browse files
Show More
@@ -555,12 +555,6 b' def getparser():'
555 help="use pure Python code instead of C extensions",
555 help="use pure Python code instead of C extensions",
556 )
556 )
557 hgconf.add_argument(
557 hgconf.add_argument(
558 "-3",
559 "--py3-warnings",
560 action="store_true",
561 help="enable Py3k warnings on Python 2.7+",
562 )
563 hgconf.add_argument(
564 "--with-chg",
558 "--with-chg",
565 metavar="CHG",
559 metavar="CHG",
566 help="use specified chg wrapper in place of hg",
560 help="use specified chg wrapper in place of hg",
@@ -748,9 +742,6 b' def parseargs(args, parser):'
748 )
742 )
749 options.timeout = 0
743 options.timeout = 0
750 options.slowtimeout = 0
744 options.slowtimeout = 0
751 if options.py3_warnings:
752 if PYTHON3:
753 parser.error('--py3-warnings can only be used on Python 2.7')
754
745
755 if options.blacklist:
746 if options.blacklist:
756 options.blacklist = parselistfiles(options.blacklist, 'blacklist')
747 options.blacklist = parselistfiles(options.blacklist, 'blacklist')
@@ -909,7 +900,6 b' class Test(unittest.TestCase):'
909 timeout=None,
900 timeout=None,
910 startport=None,
901 startport=None,
911 extraconfigopts=None,
902 extraconfigopts=None,
912 py3warnings=False,
913 shell=None,
903 shell=None,
914 hgcommand=None,
904 hgcommand=None,
915 slowtimeout=None,
905 slowtimeout=None,
@@ -942,8 +932,6 b' class Test(unittest.TestCase):'
942 must have the form "key=value" (something understood by hgrc). Values
932 must have the form "key=value" (something understood by hgrc). Values
943 of the form "foo.key=value" will result in "[foo] key=value".
933 of the form "foo.key=value" will result in "[foo] key=value".
944
934
945 py3warnings enables Py3k warnings.
946
947 shell is the shell to execute tests in.
935 shell is the shell to execute tests in.
948 """
936 """
949 if timeout is None:
937 if timeout is None:
@@ -968,7 +956,6 b' class Test(unittest.TestCase):'
968 self._slowtimeout = slowtimeout
956 self._slowtimeout = slowtimeout
969 self._startport = startport
957 self._startport = startport
970 self._extraconfigopts = extraconfigopts or []
958 self._extraconfigopts = extraconfigopts or []
971 self._py3warnings = py3warnings
972 self._shell = _bytespath(shell)
959 self._shell = _bytespath(shell)
973 self._hgcommand = hgcommand or b'hg'
960 self._hgcommand = hgcommand or b'hg'
974 self._usechg = usechg
961 self._usechg = usechg
@@ -1515,9 +1502,8 b' class PythonTest(Test):'
1515 return os.path.join(self._testdir, b'%s.out' % self.bname)
1502 return os.path.join(self._testdir, b'%s.out' % self.bname)
1516
1503
1517 def _run(self, env):
1504 def _run(self, env):
1518 py3switch = self._py3warnings and b' -3' or b''
1519 # Quote the python(3) executable for Windows
1505 # Quote the python(3) executable for Windows
1520 cmd = b'"%s"%s "%s"' % (PYTHON, py3switch, self.path)
1506 cmd = b'"%s" "%s"' % (PYTHON, self.path)
1521 vlog("# Running", cmd.decode("utf-8"))
1507 vlog("# Running", cmd.decode("utf-8"))
1522 normalizenewlines = os.name == 'nt'
1508 normalizenewlines = os.name == 'nt'
1523 result = self._runcommand(cmd, env, normalizenewlines=normalizenewlines)
1509 result = self._runcommand(cmd, env, normalizenewlines=normalizenewlines)
@@ -3366,7 +3352,6 b' class TestRunner(object):'
3366 timeout=self.options.timeout,
3352 timeout=self.options.timeout,
3367 startport=self._getport(count),
3353 startport=self._getport(count),
3368 extraconfigopts=self.options.extra_config_opt,
3354 extraconfigopts=self.options.extra_config_opt,
3369 py3warnings=self.options.py3_warnings,
3370 shell=self.options.shell,
3355 shell=self.options.shell,
3371 hgcommand=self._hgcommand,
3356 hgcommand=self._hgcommand,
3372 usechg=bool(self.options.with_chg or self.options.chg),
3357 usechg=bool(self.options.with_chg or self.options.chg),
@@ -3512,15 +3497,6 b' class TestRunner(object):'
3512
3497
3513 self._usecorrectpython()
3498 self._usecorrectpython()
3514
3499
3515 if self.options.py3_warnings and not self.options.anycoverage:
3516 vlog("# Updating hg command to enable Py3k Warnings switch")
3517 with open(os.path.join(self._bindir, 'hg'), 'rb') as f:
3518 lines = [line.rstrip() for line in f]
3519 lines[0] += ' -3'
3520 with open(os.path.join(self._bindir, 'hg'), 'wb') as f:
3521 for line in lines:
3522 f.write(line + '\n')
3523
3524 hgbat = os.path.join(self._bindir, b'hg.bat')
3500 hgbat = os.path.join(self._bindir, b'hg.bat')
3525 if os.path.isfile(hgbat):
3501 if os.path.isfile(hgbat):
3526 # hg.bat expects to be put in bin/scripts while run-tests.py
3502 # hg.bat expects to be put in bin/scripts while run-tests.py
General Comments 0
You need to be logged in to leave comments. Login now