Question: I have a function that uses information from a config file. How do I test the function? Ideally, I'd want to inject my own version of the config file and test from there, but I'm not using dependency injection.

Answer: 
You have to write a test that works independent of the config file, so you can test that depending on the "simulated configuration" the output of the function or behavior of that function is correct.

You would need to inject the configuration file, or the value that you are trying to simulate on your function under test. This is the only way to guarantee that whenever you have that value, your function behavior is the indicated by the configuration file.

Ideally, you would also isolate the class that contains and dictates the behavior of the configuration file to the class/function that reads this file. When writing testing one of the goals should be isolation of the code under test.
Well, dependency injection comes to mind as a default sort of *boxed approach* to config testing.

However, there are other ways, specifically designing your code to eliminate the dependency on config file all together.

You can find more details in [a canonical example of dependency elimination](http://qualityisspeed.blogspot.com/2015/02/the-dependency-elimination-principle-a-canonical-example.html) by Brian Geihsler that talks specifically about config files.