I work with an application that can be heavily customized. In many cases for a Greenfield development, the developers and architects will decide to put in place an API that returns what environment you are currently in - usually by introspection looking at the database name but for the sake of this discussion let's avoid any pros or cons related to a specific implementation. Your results might be "Prod" which has special significance, "Test 1" which we then know has special capabilities to interface with other external systems, and "Dev 1" which is relatively not-special.
What I am wondering is if this is a good practice, a judgement call, or a bad practice.
The most obvious pro to me is that it can help automate certain nonproduction refresh tasks without deployment risk. The drawback is that we may frequently find ourselves in a place where testing is not touching code paths that will be taken in prod.