← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:remove-conflict-marker-test into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:remove-conflict-marker-test into launchpad:master.

Commit message:
Remove conflict marker test

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/420139

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/launchpad:remove-conflict-marker-test into launchpad:master.
diff --git a/lib/lp/tests/__init__.py b/lib/lp/tests/__init__.py
index 0426d89..1e5e89a 100644
--- a/lib/lp/tests/__init__.py
+++ b/lib/lp/tests/__init__.py
@@ -1,9 +1,8 @@
 # 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.
+"""Code-base-wide tests.
 
-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).
+Do not put tests for application logic in this package, only tests that
+check some project-wide phenomenon.
 """
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 35a7a62..0000000
--- a/lib/lp/tests/test_no_conflict_marker.py
+++ /dev/null
@@ -1,45 +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."""
-
-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()