diff --git a/doppel/PackageCollection.py b/doppel/PackageCollection.py
index bca655d..f56fe9a 100644
--- a/doppel/PackageCollection.py
+++ b/doppel/PackageCollection.py
@@ -8,6 +8,12 @@ class PackageCollection:
     def __init__(self, packages):
         for pkg in packages:
             assert isinstance(pkg, PackageAPI)
+
+        pkg_names = [pkg.name() for pkg in packages]
+        if (len(set(pkg_names)) < len(packages)):
+            msg = "All packages provided to PackageCollection must have unique names"
+            raise ValueError(msg)
+
         self.pkgs = packages
 
     def package_names(self) -> List[str]:

No uniqueness guarantees on "name" in PackageCollection
`PackageAPI` asks you to provide a "name" for a package dictionary. `PackageCollection` holds multiple instances of `PackageAPI`.

Currently, you can provide multiple `PackageAPI` instances with *the same "name"* to the `PackageCollection` constructor and it won't complain. It should!

To close this issue, add a check in `PackageCollection` and make it throw a fatal error if multiple packages in `pkgs` have the same name.
diff --git a/tests/test_package_collection.py b/tests/test_package_collection.py
index 5a9b668..4f879ce 100644
--- a/tests/test_package_collection.py
+++ b/tests/test_package_collection.py
@@ -97,3 +97,19 @@ class TestPackageAPI(unittest.TestCase):
             sorted(shared["LupeFiasco"]),
             sorted(["~~CONSTRUCTOR~~", "coast"])
         )
+
+    def test_same_names(self):
+        """
+        PackageCollection should reject attempts
+        to add two packages with the same name
+        """
+        self.assertRaisesRegex(
+            ValueError,
+            "All packages provided to PackageCollection must have unique names",
+            lambda: PackageCollection(
+                packages=[
+                    PackageAPI.from_json(self.py_pkg_file),
+                    PackageAPI.from_json(self.py_pkg_file)
+                ]
+            )
+        )
diff --git a/tests/test_reporters.py b/tests/test_reporters.py
index 01e2221..5356494 100644
--- a/tests/test_reporters.py
+++ b/tests/test_reporters.py
@@ -31,6 +31,9 @@ BASE_PACKAGE = {
     "classes": {}
 }
 
+BASE_PACKAGE2 = copy.deepcopy(BASE_PACKAGE)
+BASE_PACKAGE2['name'] = 'pkg2'
+
 # testing different function stuff
 PACKAGE_WITH_DIFFERENT_ARG_NUMBER = copy.deepcopy(BASE_PACKAGE)
 PACKAGE_WITH_DIFFERENT_ARG_NUMBER['name'] = 'pkg2'
@@ -89,6 +92,8 @@ PACKAGE_EMPTY = {
     "functions": {},
     "classes": {}
 }
+PACKAGE_EMPTY2 = copy.deepcopy(PACKAGE_EMPTY)
+PACKAGE_EMPTY2['name'] = 'pkg2'
 
 
 PACKAGE_BEEFY = copy.deepcopy(BASE_PACKAGE)
@@ -108,6 +113,9 @@ for i in range(5):
         }
     }
 
+PACKAGE_BEEFY2 = copy.deepcopy(PACKAGE_BEEFY)
+PACKAGE_BEEFY2['name'] = 'pkg2'
+
 
 class TestSimpleReporter(unittest.TestCase):
 
@@ -206,7 +214,7 @@ class TestSimpleReporter(unittest.TestCase):
         if the shared function is the same in both packages.
         """
         reporter = SimpleReporter(
-            pkgs=[PackageAPI(BASE_PACKAGE), PackageAPI(BASE_PACKAGE)],
+            pkgs=[PackageAPI(BASE_PACKAGE), PackageAPI(BASE_PACKAGE2)],
             errors_allowed=0
         )
         reporter._check_function_args()
@@ -288,7 +296,7 @@ class TestSimpleReporter(unittest.TestCase):
         are totally empty.
         """
         reporter = SimpleReporter(
-            pkgs=[PackageAPI(PACKAGE_EMPTY), PackageAPI(PACKAGE_EMPTY)],
+            pkgs=[PackageAPI(PACKAGE_EMPTY), PackageAPI(PACKAGE_EMPTY2)],
             errors_allowed=0
         )
         reporter._check_function_args()
@@ -319,7 +327,7 @@ class TestSimpleReporter(unittest.TestCase):
         on shared classes and functions)
         """
         reporter = SimpleReporter(
-            pkgs=[PackageAPI(PACKAGE_BEEFY), PackageAPI(PACKAGE_BEEFY)],
+            pkgs=[PackageAPI(PACKAGE_BEEFY), PackageAPI(PACKAGE_BEEFY2)],
             errors_allowed=100
         )
 

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
click==8.0.4
coverage==6.2
docutils==0.18.1
-e git+https://github.com/jameslamb/doppel-cli.git@857adf804b1e5edd336608a5d3c0f517d2c3117c#egg=doppel_cli
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytz==2025.2
requests==2.27.1
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-autodoc-typehints==1.12.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tabulate==0.8.10
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: doppel-cli
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - click==8.0.4
      - coverage==6.2
      - docutils==0.18.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytz==2025.2
      - requests==2.27.1
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-autodoc-typehints==1.12.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tabulate==0.8.10
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/doppel-cli

tests/test_package_collection.py::TestPackageAPI::test_same_names
tests/test_package_collection.py::TestPackageAPI::test_all_classes tests/test_package_collection.py::TestPackageAPI::test_all_functions tests/test_package_collection.py::TestPackageAPI::test_non_shared_classes tests/test_package_collection.py::TestPackageAPI::test_non_shared_functions tests/test_package_collection.py::TestPackageAPI::test_shared_classes tests/test_package_collection.py::TestPackageAPI::test_shared_functions tests/test_package_collection.py::TestPackageAPI::test_shared_methods_by_class tests/test_reporters.py::TestSimpleReporter::test_function_all_wrong tests/test_reporters.py::TestSimpleReporter::test_function_arg_number tests/test_reporters.py::TestSimpleReporter::test_function_arg_order tests/test_reporters.py::TestSimpleReporter::test_function_args tests/test_reporters.py::TestSimpleReporter::test_identical_functions tests/test_reporters.py::TestSimpleReporter::test_other_smoke_test tests/test_reporters.py::TestSimpleReporter::test_public_method_arg_number tests/test_reporters.py::TestSimpleReporter::test_public_method_arg_order tests/test_reporters.py::TestSimpleReporter::test_public_method_args tests/test_reporters.py::TestSimpleReporter::test_smoke_test tests/test_reporters.py::TestSimpleReporter::test_totally_empty
doppel/PackageCollection.py
doppel/PackageCollection.py