Previous studies from our group have shown that risk assessment behaviors are the primary contextual fear responses to predatory and social threats, whereas freezing is the main contextual fear response to physically harmful events. To test contextual fear responses to a predator or aggressive conspecific threat, we developed a model that involves placing the animal in an apparatus where it can avoid the threat-associated environment. Conversely, in studies that use shock-based fear conditioning, the animals are usually confined inside the conditioning chamber during the contextual fear test. In the present study, we tested shock-based contextual fear responses using two different behavioral testing conditions: confining the animal in the conditioning chamber or placing the animal in an apparatus with free access to the conditioning compartment. Our results showed that during the contextual fear test, the animals confined to the shock chamber exhibited significantly more freezing. In contrast, the animals that could avoid the conditioning compartment displayed almost no freezing and exhibited risk assessment responses (i.e., crouch-sniff and stretch postures) and burying behavior. In addition, the animals that were able to avoid the shock chamber had increased Fos expression in the juxtadorsomedial lateral hypothalamic area, the dorsomedial part of the dorsal premammillary nucleus and the lateral and dorsomedial parts of the periaqueductal gray, which are elements of a septo/hippocampal-hypothalamic-brainstem circuit that is putatively involved in mediating contextual avoidance. Overall, the present findings show that testing conditions significantly influence both behavioral responses and the activation of circuits involved in contextual avoidance.