launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #28364
[Merge] ~cjwatson/lp-codeimport:remove-conflict-marker-test into lp-codeimport:master
Colin Watson has proposed merging ~cjwatson/lp-codeimport:remove-conflict-marker-test into lp-codeimport:master with ~cjwatson/lp-codeimport:remove-format-imports as a prerequisite.
Commit message:
Remove conflict marker test
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/lp-codeimport/+git/lp-codeimport/+merge/420017
It's now been superseded by the `check-merge-conflict` pre-commit hook.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/lp-codeimport:remove-conflict-marker-test into lp-codeimport:master.
diff --git a/lib/lp/tests/__init__.py b/lib/lp/tests/__init__.py
deleted file mode 100644
index 0426d89..0000000
--- a/lib/lp/tests/__init__.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright 2011 Canonical Ltd. This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-"""Tests for code-base sanity.
-
-Do not put tests for application logic in this package. Only tests that check
-some project-wide phenomenon (such as there being no conflict markers in the
-code base).
-"""
diff --git a/lib/lp/tests/test_no_conflict_marker.py b/lib/lp/tests/test_no_conflict_marker.py
deleted file mode 100644
index f3cade4..0000000
--- a/lib/lp/tests/test_no_conflict_marker.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2009-2020 Canonical Ltd. This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-"""Test that no files in the tree has spurious conflicts markers."""
-
-__metaclass__ = type
-
-import os
-import subprocess
-import unittest
-
-
-class NoSpuriousConflictsMarkerTest(unittest.TestCase):
- """Check each file in the working tree for spurious conflicts markers."""
-
- # We do not check for ======= because it might match some
- # old heading style in some doctests.
- CONFLICT_MARKER_RE = r'^\(<<<<<<< \|>>>>>>> \)'
-
- # XXX cjwatson 2019-09-25: It may be simpler to use something based on
- # "git diff --check", but we'd need to work out what to do about its
- # whitespace checks.
- def test_noSpuriousConflictsMarker(self):
- """Fail if any spurious conflicts markers are found."""
- root_dir = os.path.join(os.path.dirname(__file__), '../../..')
-
- list_files = subprocess.Popen(
- ['git', 'ls-files'], stdout=subprocess.PIPE, cwd=root_dir)
- unique_files = subprocess.Popen(
- ['sort', '-u'],
- stdin=list_files.stdout, stdout=subprocess.PIPE)
- grep = subprocess.Popen(
- ['xargs', 'grep', '-s', self.CONFLICT_MARKER_RE],
- stdin=unique_files.stdout, stdout=subprocess.PIPE, cwd=root_dir)
- out = grep.communicate()[0]
- self.assertFalse(
- len(out), 'Found spurious conflicts marker:\n%s' % out)
-
-
-def test_suite():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(NoSpuriousConflictsMarkerTest))
- return suite
-
-
-if __name__ == '__main__':
- unittest.main()