Show More
@@ -555,12 +555,6 b' def getparser():' | |||
|
555 | 555 | help="use pure Python code instead of C extensions", |
|
556 | 556 | ) |
|
557 | 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 | 558 | "--with-chg", |
|
565 | 559 | metavar="CHG", |
|
566 | 560 | help="use specified chg wrapper in place of hg", |
@@ -748,9 +742,6 b' def parseargs(args, parser):' | |||
|
748 | 742 | ) |
|
749 | 743 | options.timeout = 0 |
|
750 | 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 | 746 | if options.blacklist: |
|
756 | 747 | options.blacklist = parselistfiles(options.blacklist, 'blacklist') |
@@ -909,7 +900,6 b' class Test(unittest.TestCase):' | |||
|
909 | 900 | timeout=None, |
|
910 | 901 | startport=None, |
|
911 | 902 | extraconfigopts=None, |
|
912 | py3warnings=False, | |
|
913 | 903 | shell=None, |
|
914 | 904 | hgcommand=None, |
|
915 | 905 | slowtimeout=None, |
@@ -942,8 +932,6 b' class Test(unittest.TestCase):' | |||
|
942 | 932 | must have the form "key=value" (something understood by hgrc). Values |
|
943 | 933 | of the form "foo.key=value" will result in "[foo] key=value". |
|
944 | 934 | |
|
945 | py3warnings enables Py3k warnings. | |
|
946 | ||
|
947 | 935 | shell is the shell to execute tests in. |
|
948 | 936 | """ |
|
949 | 937 | if timeout is None: |
@@ -968,7 +956,6 b' class Test(unittest.TestCase):' | |||
|
968 | 956 | self._slowtimeout = slowtimeout |
|
969 | 957 | self._startport = startport |
|
970 | 958 | self._extraconfigopts = extraconfigopts or [] |
|
971 | self._py3warnings = py3warnings | |
|
972 | 959 | self._shell = _bytespath(shell) |
|
973 | 960 | self._hgcommand = hgcommand or b'hg' |
|
974 | 961 | self._usechg = usechg |
@@ -1515,9 +1502,8 b' class PythonTest(Test):' | |||
|
1515 | 1502 | return os.path.join(self._testdir, b'%s.out' % self.bname) |
|
1516 | 1503 | |
|
1517 | 1504 | def _run(self, env): |
|
1518 | py3switch = self._py3warnings and b' -3' or b'' | |
|
1519 | 1505 | # Quote the python(3) executable for Windows |
|
1520 |
cmd = b'"%s" |
|
|
1506 | cmd = b'"%s" "%s"' % (PYTHON, self.path) | |
|
1521 | 1507 | vlog("# Running", cmd.decode("utf-8")) |
|
1522 | 1508 | normalizenewlines = os.name == 'nt' |
|
1523 | 1509 | result = self._runcommand(cmd, env, normalizenewlines=normalizenewlines) |
@@ -3366,7 +3352,6 b' class TestRunner(object):' | |||
|
3366 | 3352 | timeout=self.options.timeout, |
|
3367 | 3353 | startport=self._getport(count), |
|
3368 | 3354 | extraconfigopts=self.options.extra_config_opt, |
|
3369 | py3warnings=self.options.py3_warnings, | |
|
3370 | 3355 | shell=self.options.shell, |
|
3371 | 3356 | hgcommand=self._hgcommand, |
|
3372 | 3357 | usechg=bool(self.options.with_chg or self.options.chg), |
@@ -3512,15 +3497,6 b' class TestRunner(object):' | |||
|
3512 | 3497 | |
|
3513 | 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 | 3500 | hgbat = os.path.join(self._bindir, b'hg.bat') |
|
3525 | 3501 | if os.path.isfile(hgbat): |
|
3526 | 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