KenFrench.jl (798B)
1 @testset "Importing Fama-French factors from Ken French library" begin 2 3 import Dates 4 5 df_FF3_annual = FinanceRoutines.import_FF3(frequency=:annual) 6 @test names(df_FF3_annual) == ["datey", "mktrf", "smb", "hml", "rf"] 7 @test nrow(df_FF3_annual) >= Dates.year(Dates.today() - Dates.Month(1)) - 1926 - 1 8 9 df_FF3_monthly = FinanceRoutines.import_FF3(frequency=:monthly); 10 @test names(df_FF3_monthly) == ["datem", "mktrf", "smb", "hml", "rf"] 11 @test nrow(df_FF3_monthly) >= (Dates.year(Dates.today()) - 1926 - 1) * 12 12 13 df_FF3_daily = FinanceRoutines.import_FF3(frequency=:daily); 14 @test names(df_FF3_daily) == ["date", "mktrf", "smb", "hml", "rf"] 15 @test nrow(df_FF3_daily) >= 25_900 & nrow(df_FF3_daily) <= 26_500 16 17 18 end