# \[pkg test\] Error on explicit mention of tested package in Project.toml

**URL:** https://discourse.julialang.org/t/pkg-test-error-on-explicit-mention-of-tested-package-in-project-toml/41125
**Category:** General Usage
**Tags:** package, testing
**Created:** [June 10, 2020, 1:35pm UTC](https://discourse.julialang.org/t/pkg-test-error-on-explicit-mention-of-tested-package-in-project-toml/41125 "2020-06-10T13:35:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ksamtsak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksamtsak/32/10585_2.png) [@ksamtsak](https://discourse.julialang.org/u/ksamtsak)
#### Post date: [June 10, 2020, 1:35pm UTC](https://discourse.julialang.org/t/pkg-test-error-on-explicit-mention-of-tested-package-in-project-toml/41125/1 "2020-06-10T13:35:51Z")

</div>

I’m describing my test-specific dependencies (julia 1.4) in `test/Project.toml` [according to the docs](https://julialang.github.io/Pkg.jl/v1/creating-packages/#Test-specific-dependencies-in-Julia-1.2-and-above-1). It’s also mentioned in the docs that:

> Pkg will add the tested package itself implictly

I’d like however to be able to easily run my test scripts independently from `Pkg.test` for greater flexibility. I tried therefore adding an explicit dependency to the package I’m developing in `test/Project.toml`, since after all it sounds like something that `Pkg` does anyway when testing.

Sure enough, I can now run my test scripts independently. However when I actually use them through `Pkg.test` I get the following error:

```julia
ERROR: can not merge projects

```

Is this a feature or a bug?

Is there a better way to do what I want to do?

Thanks! 😃

---

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [June 11, 2020, 6:53pm UTC](https://discourse.julialang.org/t/pkg-test-error-on-explicit-mention-of-tested-package-in-project-toml/41125/2 "2020-06-11T18:53:25Z")

</div>

Ummm, for all my modules I have Test as a dependency in the `test/Project.toml` file and I don’t have issues. Do you get some sort of stack trace?

---

<div class="post-metadata">

### Author: ![ksamtsak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksamtsak/32/10585_2.png) [@ksamtsak](https://discourse.julialang.org/u/ksamtsak)
#### Post date: [June 11, 2020, 7:22pm UTC](https://discourse.julialang.org/t/pkg-test-error-on-explicit-mention-of-tested-package-in-project-toml/41125/3 "2020-06-11T19:22:43Z")

</div>

I’m not referring to `Test`, but to the package I’m testing.

I’m developing package `X`. `test/Project.toml` looks like:

```julia
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
X = "db654dba-670c-566a-9226-64313b881ded"

```

I’m talking about the last line: having the under development package `X` as a dependency in its own test environment.

---

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [June 11, 2020, 7:59pm UTC](https://discourse.julialang.org/t/pkg-test-error-on-explicit-mention-of-tested-package-in-project-toml/41125/4 "2020-06-11T19:59:12Z")

</div>

Sorry, I understand now. You might be able to do something like:

```julia
using Pkg

Pkg.activate("test")
Pkg.develop("/path/to/X")
Pkg.instantiate();

include("runtests.jl")

Pkg.rm("X")

```

I’m not 100% that will work though.

---

<div class="post-metadata">

### Author: ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)
#### Post date: [November 7, 2021, 7:29pm UTC](https://discourse.julialang.org/t/pkg-test-error-on-explicit-mention-of-tested-package-in-project-toml/41125/5 "2021-11-07T19:29:34Z")

</div>

it looks that it is indeed a bug: [https://github.com/JuliaLang/Pkg.jl/issues/1585](https://github.com/JuliaLang/Pkg.jl/issues/1585)
