Elixir 编译错误:模块 ExUnitProperties 未加载且无法找到

问题描述 投票:0回答:1

我将 Elixir 的版本从 1.7.4 升级到 1.15,现在我尝试运行

MIX_ENV=test mix test
,但一直收到错误
module ExUnitProperties is not loaded and could not be found
我的 mix.exs 有
{:stream_data, "~> 0.1", only: :test, runtime: false}
。我尝试将
stream_data
升级到最新版本,但没有成功。

这是我已经尝试过的(MIX_ENV =测试):

  1. mix deps.clean
  2. mix compile --force
  3. mix deps.tree
    显示├──stream_data ~> 0.1(十六进制封装)

mix.exs 有:

defp elixirc_paths(:test), do: ["lib", "test/support", "test/fixtures"]

完整的错误是:

error: module ExUnitProperties is not loaded and could not be found. This may be happening because the module you are trying to load directly or indirectly depends on the current module
  test/support/generators.ex:4: Ab.Generators (module)

generators.ex 是:

defmodule Ab.Generators do
  @moduledoc "Generators to use for property testing"

  use ExUnitProperties
  alias Ab.SafeTimex

  def datetime do
    ExUnitProperties.gen all(
                           year <- StreamData.member_of(1990..2030),
                           month <- StreamData.member_of(1..12),
                           day <- StreamData.member_of(1..31),
                           hour <- StreamData.member_of(0..23),
                           minute <- StreamData.member_of(0..59),
                           second <- StreamData.member_of(0..59)
                         ) do
      NaiveDateTime.new(year, month, day, hour, minute, second)
    end
    |> StreamData.filter(&match?({:ok, _}, &1))
    |> StreamData.map(&elem(&1, 1))
    |> StreamData.map(&SafeTimex.to_datetime(&1, :utc))
  end
end

有什么想法或建议吗?谢谢!

elixir elixir-mix
1个回答
0
投票

如果删除

runtime: false
会发生什么?

© www.soinside.com 2019 - 2024. All rights reserved.